Change css for certain user roles

I am trying to do a #tribe_events_event_options{display:none;} for all the author users on my site. I don't want them to be able to set an event to featured, and I thought the simplest way was to not display the box.

Is there an easy way to target user groups for custom css? I've made a author.css file in the child theme folder.

I found this post, but It did not do it for me. Custom CSS In Admin Only For Certain Roles

function wpa66834_role_admin_body_class( $classes ) {
global $current_user;
foreach( $current_user-roles as $role )
    $classes .= ' role-' . $role;
return trim( $classes );
}
add_filter( 'admin_body_class', 'wpa66834_role_admin_body_class' );

Writing css like: example

.role-editor #main-header {display:none;}

But the css is not affected. Am I missing something?

Thanks in advance!

Topic css users Wordpress

Category Web


Your code seems to be correct maybe your selector is wrong? can you post the body html of your page that is outputed?

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.