Monday 11 November 2013

Change WordPress Login Logo Without Plugins

Important: All scripts hosted on widcraft.googlecode.com don't work anymore because Google has blocked that SVN repository.
Above is a screen shot of the login page of my WordPress website. As you can see in above image, I'm using my website's logo in the login page instead of WordPress logo. And it looks pretty good.

If you're running a website with public registration or a client website, then you should replace the default logo with your own. There are lots of plugins to change the custom logo in some easy steps. However, we're going to do this without any plugin.

Add this snippet to the functions.php file of your active theme:

<?php
function custom_login_logo() {
    echo '<style type="text/css">
        h1 a { background-image:url('CUSTOM-LOGO-URL.png') !important; }
    </style>';
}
add_action('login_head', 'custom_login_logo');
?>

Replace the CUSTOM-LOGO-URL.png in above code with url of your custom login logo. That's it.
Important: Check our new website TricksPanda.com for WordPress tutorials, plugins and more.
 
Powered by Blogger.