Wordpress自定义后台登录页面logo和url

Function代码

//自定义后台登录页面logo和url,by minirizhi.com
function custom_loginlogo() {
echo '<style type="text/css">
h1 a {background: url('.get_bloginfo('template_directory').'/assets/img/logo-m.png) !important;}
</style>';
}
add_action('login_head', 'custom_loginlogo');
function custom_loginlogo_url($url) {
return home_url();
}
add_filter( 'login_headerurl', 'custom_loginlogo_url' );
function custom_login_headertitle(){
    return get_bloginfo('name');
}
add_filter('login_headertitle', 'custom_login_headertitle');
文章目录