@Kevin,这里有几个选项如何覆盖登录页面的css。
通过login_enqueue_scripts
如果使用此挂钩,则需要创建与相同路径的css文件functions.php, 说login-style.css, 在内部添加代码,更改属性背景图像,如下所示background-image: url(assets/images/logo.png); (确保路径正确),并使用wp_enqueue_style 在里面functions.php. 我们使用login 作为手柄login-style.css, 它会将您的css置于默认WP样式之后。
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由于您的css中有php代码,因此使用此挂钩,您的内联css代码将放在默认WP样式之后。
add_action( \'login_head\', \'my_login_logo\' );