Customize Login Logo in WordPress

This is great for adding more branding to your site or for your client’s site. It gets more attractive to your users when you take care of such things to improve your branding.

/**
 * Snippet Name:  Remove Product Permalink from Thank You Page
 * Snippet URL:  wpsnippets.dev
 */
 
// customize login logo
function wps_custom_login_logo() {

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

    add_action('login_head', 'wps_custom_login_logo');

Code Explanation

  • First, add the logo to your theme’s images folder. If you don’t find any such folder, then create it and add the logo. Don’t forget to replace the name custom-logo with your logo name. Make sure you add this code to the function.php file of your child theme.
  • Here, we are displaying our logo through the background-image property and passing the path of the image.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top