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
- When using https, WordPress doesn’t use https for CSS and JavaScript, and admin doesn’t work. How do I fix this?
- What’s the difference between SCSS and Sass?
- CSS opacity only to background color, not the text on it?
- How do I center floated elements?
- Make div scrollable
- How do I center an h1 in the body
- Why “Inline-block” doesn’t work properly in this CSS?
- How to fade an image with CSS without opacity?
- Flushing footer to bottom of the page, twitter bootstrap
- CSS transition fade in
- Responsive media query not working in Google Chrome
- Contain an image within a div?
- Failed to decode downloaded font
- CSS fill remaining width
- TinyMCE: adding CSS to format dropdown
- wp_get_archives() – Get CSS selector for current month
- Do I only need to import style.css for a child theme?
- Disable child theme css on certain pages
- How to load a css file in one page only?
- How to add custom fonts in WordPress site
- Handling URLs in WordPress application
- Extending content width with twentyfourteen theme
- CSS file not registering through add_action
- Custom Admin CSS styles to style media uploader?
- getting url in wp_enqueue_style
- Gutenberg Additional CSS Class without modifying theme?
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- Unable to load CSS file (HTTP 403)
- how to add custom css and js on wordpress post editor directly without using .php file
- how to setup content on a static frontpage with css and xhtml
- wp_enqueue_style – CSS Not loading – ERR_TOO_MANY_REDIRECTS [closed]
- Help with child theme enqueuing additional css files
- Why does my caroussel gallery do this in responsive? [CSS] [closed]
- Website CSS not loading [closed]
- Custom styles dropdown in TinyMCE editor – not working with headings
- Child theme CSS not applying to element
- Google yolo one tab signup plugin avilable in wordpress? [closed]
- Make CSS Changes To Only Affect Mobile Browser [closed]
- Disable File Editing function
- wp_enqueue_scripts and CSS
- User gets access denied to css files and js files even though user is logged in [closed]
- Getting values from options page to css
- Conditionally enqueue a stylesheet based off of a javascript click event
- WordPress 6 – inline container styles breaking my site
- How to make a difference between the portfolio list, and a portfolio item?
- how to stop the shaking effect on my homepage [closed]
- List item images perfect on Chrome/Edge, css fudged on FF/IE [closed]
- Cannot change hover color for links [closed]
- prevent HTML output if custom field is empty [closed]
- How to make jquery slider to start afresh [closed]
- Custom CSS based on the Author of a Post
- How to properly hide the div of an inline collapsible button?
- How can we create our own formatting style?
- Is it better to add to style.css or create your own css when using a template?
- Hide Login Page Labels
- Content alignment in Twenty Fourteen Theme
- Extending site width according to the image size
- Animate.CSS with a child theme
- Managing large CSS files [closed]
- Removing Author name
- How would I use a media query to make my entire theme responsive or fluid? [closed]
- Clear white line off page [closed]
- Strange symbols on page [closed]
- How to make this splash page responsive
- Menu is not styled properly and footer as well [closed]
- Footer in middle of page in different browers [closed]
- How do I add JS and CSS to WP (Flatsome)
- “Plate” theme broken after update
- Style.css file gets restored to default version
- Wrong mime types served