Chaging the logo on the loging WordPress page

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.

/* 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.


Comments

Leave a Reply

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