You have built a new client’s website and you want to change the WordPress logo on the login page (wp-login.php), well there is nothing more easy then this. Add the following code to your theme’s function.php.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
/* Change WordPress login page logo image */ function new_login_page_logo() { ?>; <style type=”text/css”> .login h1 a{ background-image: url(‘http://yoursite.com/path/to/the/img.png’); background-size: auto; margin: 0 auto; height: whatever_you_want; width: whatever_you_want; } </style> <?php } add_action(‘login_head’, ‘new_login_page_logo’); |
What actually is happening is that you are hooking the new_login_page_logo
function to the login_head
action and replace the original css.
So, what else? Well, you can play with whatever styles you would like.
And if you want to make this settings customizable from the admin panel – check the article for adding new options to the WordPress theme in the Customize panel of the Theme.