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
- What is WebKit and how is it related to CSS?
- How can I vertically center a “div” element for all browsers using CSS?
- How do I hide the bullets on my list for the sidebar?
- CSS display: inline vs inline-block
- Aligning two divs side-by-side
- How to center HTML5 Videos?
- Text border using css (border around text)
- Is there an opposite CSS pseudo-class to :hover?
- U8Qtu
- How can I transition height: 0; to height: auto; using CSS?
- Display Images Inline via CSS
- Using margin / padding to space span tag from the rest of the p tag
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- How to change version of .css in WordPress?
- Style something only on the home page
- How do I register/enqueue a custom CSS file?
- Why isn’t my theme processing SASS?
- Trying to load a responsive CSS media query using Custom Taxonmy
- Changing CSS in Twenty Eleven to change font size of body text
- What is better way to use Bootstrap inside admin panel?
- How to load different css file depending on language
- I want to change my post titles from h2 to H1
- Change logo on specific page id using css
- Write text below a specific part of a sentence
- Style classic editor buttons
- Remove id attribute from stylesheet link
- Layer post title on top of image WordPress featured thumbnail image
- Twig + wordpress – how to get filemtime for style.css
- Font embedding in wordpress
- Inconsistent `body_class()` function
- How to Add Custom CSS to the Media Thickbox?
- Link theme options page using ACF to styles
- WordPress Light/Dark Theme best practices? Is there a way that really works?
- How to change H1 color only for pages [closed]
- Background image reversed on pages after home page [closed]
- How to get an unique identifier for a page/post/category/tag etc.?
- Remove CSS Attribute by Overriding CSS in Child Theme
- CSS gap issue in div element
- Override Admin menu icon
- WordPress custom CSS file overrided by internal CSS [closed]
- Can you change the color of svg icons to the global color I choose from WordPress
- After moving my site, sub-menus are not showing [closed]
- Theme twentythirteen widget area clearfix
- Disable CSS for IE 8 and earlier.
- Using categories on navigation bar instead of pages
- I have a wordpress website which uses a really weird font on Opera. What do I need to do to fix it?
- Elementor – Edit Global Colors Order
- the_post layout
- Modal dialog under the backdrop
- Hot reload failing to update file changes
- Clickable Text To Replace Radio buttons
- How to remove the specific class
- Customizer Appearance Issue
- Change mobile menu color from red to another color
- Change the version of default style.css in wordpress
- style.css not working but customizer additional css does?
- Hide duplicate entry title
- How to set different color in a select box due to selection with css
- Fonts are parsed in one way but rendered in a different way
- WP Page Builder – Remove table border?
- How to implement a JavaScript and CSS file for my WordPress homepage?
- Creating a custom header
- Is it possible to make invisible a div only on certain pages using CSS?
- What CSS selectors to know for WordPress? [closed]
- MY CSS FILE IS MISBEHAVING. IS NOT WORKING WELL ON MY WP SITE [closed]
- How to avoid problems caused by new block-library default CSS rules (wp 6.1.1)
- Grid problem on privew mode
- Disabling double vertical scrollbar and horizontal scrolling?
- Customize margin between paragraphs using the Gutenberg Style editor
- How to remove automatically added custom style tag?