How To Replace The WordPress Logo On Login With Your Own Logo

The WordPress logo on the login page can be confusing to your users, who would naturally expect imagery that matches your website.  To replace the WordPress logo with your own, add the following code to your functions.php file.  Replace the value for $my_logo with the location of your own logo.

Unless your logo is the same width as the WordPress logo size setting, it will be resized to 84px.  The additional CSS included below allows your logo to appear at full width inside the login container div.

///////////
// Replace logo on login page
///////////
function uwp_login_logo() {
  $my_logo = get_template_directory_uri() . '/images/my_logo.png';
  ?>
  <style type="text/css">
  body.login div#login h1 a {
    background-image: url( <?php echo $my_logo; ?> );
    padding-bottom: 30px;
    height: auto;
    width: 100%;
    background-size: 100%;
  }
  </style>
   <?php
}
add_action( 'login_enqueue_scripts', 'uwp_login_logo' );

 

Available for Amazon Prime