Change WordPress login logo to site logo in the default login page

There are many situations when you want to change the login logo of WordPress login. When you deliver your website, Your client requests to use its logo instead of the WordPress default logo.
Many Developers achieve this task by changing the stylesheet and replace the default logo. But It is not an appropriate way.
You have to copy and paste the following PHP code to WordPress active plugin file or in the function.php file of your currently active theme.

function custom_prefix_my_login_logo() {
    echo '<style type="text/css>
            h1 a {
                background-image:url('.get_bloginfo('template_directory').'/images/login-logo.gif) !important;
            }
        </style>';
}
add_action('login_head', 'custom_prefix_my_login_logo');


Discover more from Prashant Baldha on WordPress

Subscribe to get the latest posts sent to your email.

Comments

Leave a Reply

Discover more from Prashant Baldha on WordPress

Subscribe now to keep reading and get access to the full archive.

Continue reading