How to change the login logo in WordPress

Do you want to add your own logo to the log-in page of your WordPress blog or website? The reasons for replacing the WordPress logo on the log-in page of your WordPress blog with your own can be multiple. You might be working on a client’s website that requires user login. Your website might be offering membership. A custom login logo to match the branding makes a very positive impression on your users. How to change the login logo in WordPress?

Copy the following code and add it to the functions.php file of your theme. As simple as that. Don’t forget to add your transparent logo to the ‘images’ folder inside the theme folder. You can also use any image, hosted anywhere. Just make sure that the background image is set properly.

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