When building sites for clients, you may want to change the default WordPress login logo to the clients brand logo and URL. And, for those site’s that require a login every time, or those with multi authors can create a good impression and give that professional touch by displaying their own company/blog log instead of WordPress logo.
Add the following piece of code into your theme’s functions.php file.
[php]
function my_custom_login_logo() {
echo ‘
‘;
}
add_action(‘login_head’, ‘my_custom_login_logo’);
[/php]
You have to upload your brand/blog image (in this case custom-login-logo.png) in your theme’s images directory.
With the previous code you have changed the logo and now you can change the URL of your WordPress blog/site by adding this second function to the functions.php file.
[php]
function my_custom_login_url() {
return site_url();
}
add_filter( ‘login_headerurl’, ‘my_custom_login_url’, 10, 4 );
[/php]
In this way you will be able to retain the changes without losing them with any update of WordPress.
You may also be interested in our other articles on align divs horizontally, improve wordpress jpeg image quality, increase the size of excerpt field, and exclude categories from blog wordpress.
Leave a Reply