Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a question about deregistering 'wp-admin' styles specifically on the login screen.

If I just globally run:

<?php wp_deregister_style( 'wp-admin' ); ?>

my login screen will have no styles.

If I run a function like:

function remove_default_styles() {
    wp_deregister_style( 'wp-admin' );
}
add_action( 'admin_enqueue_scripts', 'remove_default_styles' );

this removes the styles successfully in the admin area, but not on the login page.

However, if I run the same function with a login action, like so:

add_action( 'login_enqueue_scripts', 'remove_default_styles' );

it has no effect.

Does anyone know how to deregister the default styles just on the login screen?

Thanks

share|improve this question
    
Oh. It seems like the action I needed was 'login_init'. Like so: function login_remove_scripts() { wp_deregister_style( 'wp-admin' ); } add_action( 'login_init', 'login_remove_scripts' ); –  user19918 Aug 31 '12 at 18:37
    
Please write a full answer, so I can vote for your solution. And welcome to WordPress Stack Exchange. :) –  toscho Aug 31 '12 at 18:43
    
Hey, thanks, toscho. I am new here. Great resource! I'm so new, in fact, that I have to wait several hours before I'm allowed to answer myself. That's why I did a comment for now. I'll come back. Thanks for your welcome :) –  user19918 Aug 31 '12 at 20:28
add comment

1 Answer 1

Oh. It seems like the action I needed was 'login_init'. Like so:

function login_remove_scripts() {
    wp_deregister_style( 'wp-admin' );
}
add_action( 'login_init', 'login_remove_scripts' );
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.