You can add custom css on your html header using wp_head hook action & checking your current User Role
add_action('wp_head', 'add_css_of_current_specific_user_role');
function add_css_of_current_specific_user_role()
{
/*Check Current User is Login*/
if ( is_user_logged_in() )
{
$user = wp_get_current_user();
/*Check Current User Role*/
if (in_array('visitor', $user->roles)) { ?>
<style>
// Some CSS
</style>
<?php }
}
}
Related Posts:
- If post by specific role different css to everyone
- Change color of audio player depending on user role
- How do I apply/target CSS to a specific user role or roles?
- How to insert the current user’s role into the body class in the admin backend
- check the first login for specific roles
- How to insert spaces/tabs in text using HTML/CSS
- How to make the HTML link activated by clicking on the
- ?
- How would you make two s overlap?
- CSS text-align not working
- How can I insert vertical blank space into an html document?
- How can I make Bootstrap columns all the same height?
- Align text to the bottom of a div
- How to make a
- display in a horizontal row
- CSS3 Scale Animation Keyframes
- JavaFX css themes
- Border Position
- Bootstrap align navbar items to the right
- Responsive Canvas in Bootstrap column?
- How do you avoid caching during development?
- Are there Gutenberg container blocks?
- Get parent category class in post_class()
- Why won’t child theme’s style.css override plugin’s css
- WordPress – https : Css and Js files are not working (load on http instead of https)
- some things in child theme css not overriding parent
- Is it possible to create a full width row in WordPress’s editor window? [closed]
- How do I find (index) file in order to change style on CSS?
- Enqueue style for Password Reset page
- How to change header & footer to full width? [closed]
- Styleswitcher or themeswitcher to allow user to switch back to standard view from mobile device
- Theme Check errors about missing CSS rules
- removing my underline from hyperlinks
- How to change the style.css?ver=5.4.1 in WordPress?
- why enqueued styles in header.php shows in footer?
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- How to create a custom CSS class for a specific page template?
- Add fields in customization tab to change background colours of certain classes
- Responsive Author Style in BBpress?
- Get a blank line after div by simply leaving an empty line in the editor
- Archive pages have smaller font then the rest of my website [closed]
- How to stop my themes CSS changing the WordPress interface/?
- CSS not applying in admin
- loading a custom stylesheet in a function
- Load jQuery only on home page
- Keeping CSS model open after form submission
- Sidebar button click redirect when user is not logged in instead displays it
- How do I use inline styling with WordPress?
- WordPress address URL and bloginfo
- Add class to navigation link of page
- My CSS suddenly doesn’t load anymore [closed]
- Is there a way to add new div class via a theme’s Additional CSS interface?
- Keep comments but turn off commenting
- How to remove Author and Category from a single portfolio page? [closed]
- How can I move my custom css to the very bottom of the head section?
- Wrong image path within inline styles in the head
- Long post titles don’t move to next line
- How to not load stylesheet and how to load a second stylesheet on a page
- Change the search icon in twenty fourteen
- styling isnot working in wordpress theme
- Plugins not showing up for custom template
- Using True Type Fonts (ttf) [closed]
- Horizontal drop down category with hover effect working
- Invert porfolio item order
- WordPress Sudden Loss of All CSS And Tons of JQuery Errors
- Can’t find a tag to style
- Custom CSS on mobile
- Removing Image Links from Custom Post Type
- Add inline CSS to login page with wp_add_inline_style
- Set version number in child’s style.css file
- Cannot add a class to metabox
- CSS does not Update
- I want to transfer my additional css code to my theme file–?
- WordPress changing content:”” to content: "
- How to customize Metaboxes?
- Change image using only CSS [closed]
- theme RTL make big white space in mobile mode and you need to scroll to see the site
- Why child theme stylesheet takes long time to update?
- Navigation menu disappears when I hover the mouse [closed]
- Content going full width even though container is not
- I want to change change the arrangement of the grid of posts displayed by the theme on the Search page (read the description for better understanding)
- Align divs in a basic WordPress site
- Can’t center post thumbnail with bootstrap [closed]
- Force include a stylesheet from parent theme
- How can I override an existing custom CSS rule for a specific page
- Site name not showing in browser bar, only url
- Style tag on wp_footer
- Display current category without an active link in wp_list_categories
- Outputting the blogposts or the_content()
- WordPress with PageLines theme: how to change the background color of a page? [duplicate]
- Apply Classes to post text inside editor
- Use of CSS classes in editor-blocks.css file
- Twenty Twelve theme: remove margins
- Parent style messing up with Bootstrap [closed]
- Problems when writing a post
- WordPress CSS not working properly
- Add Custom CSS Class in Child Theme [closed]
- Why is the “Additional CSS” section missing in my theme Customizer?
- Is there a way to edit the fonts of headings without a plugin (in the 2022 theme)?
- How enqueue CSS out of theme folder?
- Styling not refreshing for old visitors on WordPress
- What is unsafe about this CSS?