• Skip to main content
  • Skip to primary sidebar

WordPress, Genesis Framework and Storefront customization tutorials

  • Free
  • Premium
  • Membership
    • Login
  • Design
  • Blog
  • About
  • Contact
Home » User specific CSS for WordPress admin

User specific CSS for WordPress admin

2020-02-16 by Gabor Leave a Comment

Add this snippet to functions.php

function add_css_to_guest_user() {
    $guest_user = wp_get_current_user();

    if($guest_user && isset($guest_user->user_login) && 'guest' == $guest_user->user_login) {
        wp_enqueue_style( 'guest_admin_css', get_stylesheet_directory_uri() . '/css/wpadmin-guest.css' );
    }
}
add_action('admin_print_styles', 'add_css_to_guest_user' );

2) CSS

If You want to hide the CF7 menu item on guest user’s WordPress admin use this CSS

#toplevel_page_wpcf7 {
	display: none;
}

Filed Under: Free Tagged With: WordPress

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
WP Rocket - WordPress Caching Plugin
UpdraftPlus Premium

Disclosure: Some of the links in this site are affiliate links. I will be paid a commission if you use this link to make a purchase.

  • Privacy Policy
  • Terms of Service
  • Flames Design
© 2021 WP Flames - All Right Reserved