WordPress Change logo on wp-login page

Home » Blog » WordPress Change logo on wp-login page


If you want to change default wordpress logo on the wp-login.php page then you can change wordpress logo by your logo by just adding following lines in your theme’s function php files.

function my_custom_login_logo() {
    echo '<style type="text/css">
        h1 a { background-image:url('.get_bloginfo('template_url').'/images/login-logo.png) !important; }
    </style>';
}

add_action('login_head', 'my_custom_login_logo');

You have to upload your logo in your theme’s directory with name “login-logo.png

Source

You

Tags: , ,

6 Comments on "WordPress Change logo on wp-login page"

  1. john says:

    Excellent thanks for this good trick……

    Reply →
  2. Andrew says:

    Don’t forget to change the URL too :)

    function the_url( $url ) {
    return get_bloginfo( ‘siteurl’ );
    }
    add_filter( ‘login_headerurl’, ‘the_url’ );

    //RE: http://codex.wordpress.org/Plugin_API/Filter_Reference/login_headerurl

    Reply →
    • Andrew says:

      Oh, and the header title (so it does not say Powered by WordPress) just to be complete, here’s what we use:

      function g3_the_url() {
      return get_bloginfo( ‘siteurl’ );
      }
      add_filter( ‘login_headerurl’, ‘g3_the_url’ );
      function g3_the_header_title () {
      return get_bloginfo( ‘name’ );
      }
      add_filter( ‘login_headertitle’, ‘g3_the_header_title’ );

      Reply →
  3. srinivas says:

    Excellent code….

    Reply →

Got something to say? Go for it!

CommentLuv badge

Pro Social Toolbar http://t.co/aFplIi36 via @daddydesign - 1 week ago

 
Pro Social Toolbar http://t.co/aFplIi36 via @daddydesign1 week ago