How to stop loading stylesheets in WordPress admin area
-
This has been a real pain in the a** as I have been struggling to find out why my stylesheets are loading in WP Admin panel and making it look messy.
I am using the Bones skeleton theme and there’s a style sheet called base.css which adds 20px left to allul-lielements, now the code I am using in the theme to include base.css is this:wp_register_style( 'base', BASE_URL .'/stylesheets/base.css' ); wp_enqueue_style( 'base' );no other thing is interfering there. Also I am hooking it to the
wp_print_scriptslike this:add_action('wp_print_scripts', 'base_styles');all my javascripts are also hooked to the same hook.
Two issues:
1. Why Javascripts are loaded in head whereas styles are loaded in bottom no matter what the sequence of hooking to print_script is?
2. Why are my stylesheets base.css loaded in admin panel?I know a solution that I directly add the stylesheet in the head, but having said that, it isn’t the “Recommended” thing to do as per many wp forums.
Please help!
The topic ‘How to stop loading stylesheets in WordPress admin area’ is closed to new replies.