How to add custom css to login and admin?

That’s pretty fine and it’s the proper way to add CSS to login page. But you can also change login page CSS by below code-

function the_dramatist_custom_login_css() {
    echo '<style type="text/css"> //Write your css here </style>';
}
add_action('login_head', 'the_dramatist_custom_login_css');

This actually prints CSS code inline in the login page. And for admin CSS your way is correct.

Leave a Comment