How do I change the login logo URL and hover title?

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');

Related posts

Leave a Reply

2 comments

  1. 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

  2. You have to do is simply paste the codes below in your theme’s functions.php file:

    1. Custom Login URL :

      add_filter( 'login_headerurl', 'codecanal_loginlogo_url' );
      function codecanal_loginlogo_url($url) 
      {
        return 'http://www.codecanal.com'; 
        /* Put your desired custom URL here */ 
      } 
      
    2. Site URL :

      add_filter( 'login_headerurl', 'codecanal_loginlogo_url' ); 
      function codecanal_loginlogo_url($url) 
      {
        return home_url(); 
        /* User will be redirected to the site home page */
      } 
      

    For more detail visit following blog :
    http://www.codecanal.com/change-login-logo-url-wordpress/