Use below code into functions.php file. Make sure you are using it right way
use admin_enqueue_scripts
add_action('admin_enqueue_scripts', 'FUNCTION_NAME');function FUNCTION_NAME() {
global $current_user;
$user_id = get_current_user_id();
if(is_admin() && $user_id == '2'){
wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
}}
Related Posts:
- WordPress Sudden Loss of All CSS And Tons of JQuery Errors
- How do i use fontawesome icons in TinyMce editor?
- Gutenberg Block Editor Match Admin Styles & Frontend Styles
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- Deregister CSS style link ‘open-sans-css’
- When using https, wordpress doesn’t use https for CSS and JS, and admin doesn’t work. How do I fix this?
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- Load in wp admin assets from child theme
- Admin pages missing css
- How to apply a CSS file to my admin pages?
- How to enable table overflow scroll? (especially order list table)
- How to disable the hover effect in WordPress and Elementor?
- How to stop my themes CSS changing the WordPress interface/?
- dynamic css file for admin / backend and get_option results in Uncaught Error: Call to undefined function get_option()
- Add a unique body class for every admin page (including trash)
- Apply custom css for user role
- Custom css author role
- Button doesn’t work in the profile panel
- ACF Gut block broke wordpress default style?
- How can I add a stylesheet to the Classic Editor page?
- Stop custom Gutenberg styles taking over other admin bits?
- Text editor toolbar z-index conflict with location plugin pop
- Admin bar default color scheme for nonregistered/nonlogged users
- Lines of CSS only being delivered while logged in
- Style Radio Buttons inside Edit Page (Custom Fields)
- Adding custom css to a theme depending on whether the admin user is logged in or not
- Change Login CSS – Include instead of echo
- theme injecting css into wp-admin
- Where are the Parent themes CSS & PHP files hidden on WordPress?
- Enqueue MCE Editor CSS in admin page
- unable to find the document body in user-edit admin using javascript or CSS
- difference between code for admin, user facing (css, js)
- When using https, WordPress doesn’t use https for CSS and JavaScript, and admin doesn’t work. How do I fix this?
- Twenty Twenty Four child theme stylesheet is not being enqueued in admin panel when editing pages
- Problems when writing a post
- Site layout problems when logged in due to admin bar
- Add “sub-nav” class to a sub menu parent item
- Will the following code make my css deal with images in the optimum way?
- Current Post/Page Ancestor, CSS
- Interactive maps in wordpress
- I need css code to divide my webpage sections into two columns
- I want to change the background color on my blog posts
- Images at the same vertical position in multiple columns
- How to target only one element if more elements share the same CSS class
- CSS messes up when CACHE is cleared
- remove author and date from all posts [closed]
- css .active dropdown selects all links
- Issue with TABLE or DIV padding on Mobile [closed]
- Twenty Fourteen Theme – Moving left sidebar to the right
- How to add input search field with roudned corners?
- WordPress doesn’t respect “ver” parameter in styles [closed]
- background changed after WordPress update
- Twenty thirteen theme change the height of menu sub items
- Can’t override CSS with child theme
- Center-Align Images on Mobile Only
- s2member captcha how to make responsive – css or javascript
- Add woocommerce plugin in own theme
- Bootstrap navbar-fixed-top issues [closed]
- why does WordPress custom css convert alpha to hex values?
- How to make this splash page responsive
- Change sidebar product category text color (woocommerce) [closed]
- Menu is not styled properly and footer as well [closed]
- Footer in middle of page in different browers [closed]
- [class*=”content”]:before css styles in TwentyThirteen [closed]
- Rollover button doesn’t appear in sidebar [closed]
- How to change the CSS in one file?
- how to include other jquery file and css file in wordpress plugins
- Using browser detection and the body_class() function to modify css
- css targeting submenu current-menu-item list item [closed]
- Suddenly, all links in #content div are not clickable, but I don’t see any z-index bug? [closed]
- Hide certain div/ class only at front page
- What CSS selectors to know for WordPress? [closed]
- WordPress CSS not working properly
- Put CSS on TOP, how?
- I am trying to apply these CSS rules to x3 Post-ID’s but I can’t get it to work – any idea how I can?
- Hiding fields a form in via CSS [closed]
- In which file can I find the custom CSS code I entered?
- MY CSS FILE IS MISBEHAVING. IS NOT WORKING WELL ON MY WP SITE [closed]
- Add Custom CSS Class in Child Theme [closed]
- Custom css code in wordpress [closed]
- How to remove post view count
- Some times CSS not Applying
- Using Easy Google Fonts correctly and Droid Sans on Max OS X [closed]
- CSS does not take effects and it doesn’t show in inspect [closed]
- Overide a CSS already loaded
- Can physically see CSS changes occur when refreshing page
- WordPress toolset css struggle
- Image is very blurry
- remove white overlay [closed]
- Add Quicksand for mobile devices
- site-description css is overriden [closed]
- How can I use Advanced Custom Field Option page in CSS WordPress
- Why doesn’t media(max-width) work on h2 title?
- IE 6~8 ignoring font, background, and margins on sidebar [closed]
- How to use WordPress 3.8 back-end CSS in front-end?
- WooCommerce order note color [closed]
- Min height of page [closed]
- Hiding site title for Twentyfifteen sidebar on (responsive) desktop display size
- Why is the image in div not displayed in full-size?
- how to change the colour of this background