I am trying to change the login logo URL and hover title. I am using the code below but return bloginfo('url');
and return bloginfo('name');
aren’t outputting the desired href
and title
. I’m also using a child theme if that matters at all. What do I need to use instead of return bloginfo('url');
and return bloginfo('name');
?
/* == Change Logo URL ==============================*/
function my_url_login(){
return bloginfo('url');
}
add_filter('login_headerurl', 'my_url_login');
/* == Change Logo URL Hover Text ==============================*/
function my_url_login_hover(){
return bloginfo('name');
}
add_filter('login_headertitle', 'my_url_login_hover');
2 s
Try these filters instead
// changing the logo link from wordpress.org to your site
function mb_login_url() { return home_url(); }
add_filter( 'login_headerurl', 'mb_login_url' );
// changing the alt text on the logo to show your site name
function mb_login_title() { return get_option( 'blogname' ); }
add_filter( 'login_headertitle', 'mb_login_title' );
Though if you’re on a Network/MultiSite you might need network_home_url()
instead