There are a couple of options. One is to wrap the enqueue in a check to see if it is the admin.
if(!is_admin())
wp_enqueue_style(....);
The other is wait to enqueue the style until template_redirect.
function my_enqueue_styles() {
wp_enqueue_style(....);
}
add_action( 'template_redirect', 'my_enqueue_styles' );
Related Posts:
- Passing dynamic options from backend to frontend
- Customizing a WordPress theme without changing it?
- How can I version the main CSS file?
- Any official way to create an admin theme?
- How do I create my own admin button and theme settings page?
- How to set two different themes on one WordPress? (Desktop vs. Mobile)
- I’m trying to add an image in my CSS
- How to use scss in wordpress theme?
- How to automatically highlight syntax of code in a post?
- How to add the main style.css to my index.php?
- Getting rid of unused css directives [closed]
- hfeed CSS class in Twentyeleven Theme
- How get Themes list via REST api?
- Activate a new WordPress Theme Only for Admins
- Change Theme from Plugin based on query_vars
- How do I copy my Parent Templates to my Child Templates?
- How can I show more than 15 themes at a time in the admin menu?
- How do you create a custom WPTouch theme?
- How do I apply my CSS to a theme page?
- How do you get thumbnails to show up in the admin edit post?
- Theme Development Admin Area [closed]
- how to remove padding from left and right side? [closed]
- 404 Error while accessing the font files
- How to load parent theme style.css?
- Child Style.css not overriding parent theme style located in assets/css/main.css
- How does a Child Theme works?
- Creating new templates in child themes breaks layout
- none of my css is working in my child theme
- Posts and Pages not showing on admin, but showing in theme
- Globally register styles but enqueue them selectively
- How can I add class to every quote element?
- CSS Start Fresh option on; main.css still being loaded [closed]
- How to style the post previews/links without it affecting the main posts?
- Different logo on homepage
- How to display message (with switch_theme hook) after deactivating My theme?
- How can we hide the parent’s theme url at the child themes details on a multisite?
- How to switch theme if the current user is admin?
- Finding and disabling ‘rogue’ stylesheet from header: Source Sans Pro
- Cannot apply custom css to IE in the theme
- Need to edit themes HTML code
- Plugin and themes are adding the same stylesheets
- Child theme’s stylesheet cannot load [closed]
- Theming global variables – initializing in index.php but using in header.pho
- Is it good practice moving the main stylesheets after the plugin styles?
- Understanding the theme details in style.css
- Problems to disable the comments for my statics pages
- Re-skinning Site
- How to reset a custom theme
- Getting a ‘slide down’ js panel implemented within WP
- Need a theme that let the posted content stretched maximum width [closed]
- What’s the default order used by WordPress to load CSS files?
- The requested theme does not exist. Stylesheet is missing – error after changing style.css name to my-styles.css in wp child theme?
- Newbie wordpress question re banner height
- How to trace and resolve a theme problem such as flickering links in WordPress? [closed]
- How to integrate JSS to WordPress
- Why submenu item’s background color is not changing by css?
- Cannot figure out what element header color is in wordpress theme [closed]
- How to access theme fonts using custom CSS style? [closed]
- header.php-tweak: How to do that getting Meta-Slider into the header-center?
- Display Headings on Index page in different font sizes
- Event Organiser breaks the theme [closed]
- How to include stylesheet in custom admin using parent_slug
- Date based CSS/theme
- Menu items do not “open” when mouse hover over them?
- I made new theme directory, why won’t it show up in admin GUI?
- My blog suddenly can’t find my stylesheet?
- WP Nanoplex 1.0.3 malfunction
- Whitespace between logo and site title in Twenty Twenty-Two
- CSS appears to not work on any WordPress theme
- Broken theme, stylesheet is missing after uploading the right theme via FTP
- removing side space between para and container on generatepress?
- How can I modify the CSS only for the search results page of WordPress?
- WordPress margin issues
- How Can I Disable WordPress Theme Self-Update?
- Remove style id inline CSS in WordPress
- Theme CSS missing completely
- WordPress 404 on style.css but not on all pages
- Own Theme custom CSS does not display in editor but works in page
- Custom CSS is overwritten by WordPress?
- CSS in child theme isn’t working properly
- How to get dynamic template-function generated CSS into HEAD?
- TwentyFourteen Theme : Changing grid layout
- Using two stylesheets for mobile compatibility
- Phone numbers showing same color as header [closed]
- EM in CSS different size on wordpress then elsewhere [closed]
- Orion theme (from theme forest) [closed]
- How do I block a subdirectory from WordPress theming?
- div having different appearances in different themes
- Customising a theme
- Blog shows up without Theme/CSS styles
- Child theme after CSS modification
- How to Hide Blog Post Author?
- I can’t install theme: theme install failed
- How can I either move the nav bar down or create more space for the header? Theme – Ajaira
- Commenting in CSS (//) equals “none”? [closed]
- theme 2016 – customize css – nothing happens
- How to make a page extend full screen [closed]
- Help with Divi logo not appearing for 10s
- Custom Theme Additonal CSS “” are transformed to “>” and “<”
- How to remove pop up on website (css changes not visible)?