@Kevin, here a couple options how to overwrite css for login page.
If you use this hook, you need to create css file the same path with functions.php
, say login-style.css
, add your code inside, change your property background-image like this background-image: url(assets/images/logo.png);
( make sure your path correct ), and add your function with wp_enqueue_style
in functions.php
. We use login
as handle of login-style.css
, and it will put your css after default WP styles.
add_action( 'login_enqueue_scripts', 'my_login_logo' );
function my_login_logo()
{
wp_enqueue_style( 'login-custom-style', get_stylesheet_directory_uri(). '/login-style.css', array('login') );
}
Via login_head
Since you have php code inside your css, by use this hook, your inline css code will be put after default WP styles.
add_action( 'login_head', 'my_login_logo' );