Customize Your WordPress Login Page With Your Own Logo
The Code
This is really very basic, and simple to do. Just open up your functions.php file, and paste this code in. Change the image name logo.png according to the image you plan to use of course, which should be in your theme images folder since it is pointing to the theme directory's /images folder using get_bloginfo('template_directory'). You can see an example of it on the New2WP login page, and while your there, why not join the site!
// Use custom logo on Login page
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/logo.png) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
I found this code on WPRecipes originally, and was written by Rami.
Of course you can always choose to use a plugin, and in that case I would suggest using Theme My Login because it makes a login page within your theme. This also means yet another plugin you have to get, and if you have a lot of plugins, you may not want to add another one. This is just one way to not add more confusing options to the admin area.






User Comments
( ADD YOURS )Business Logos by Sandra August 16
Wow! I can't wait to try this. Up until now I've been hand coding all of my client's websites. I've only just decided to try and offer small businesses wordpress websites so that they can get an affordable website and make changes for themselves. This will really help brand me. Thanks.
Michael Smith November 11
I have a love-hate relationship with WP plug-ins, and what you offer here is such a simple, easy and nifty trick for changing the logo, so thank you for sharing!
Jim December 14
Great tutorial for noobs. With so many people hopping on the WordPress bandwagon tips like this are more and more useful by greater numbers of people. Thanks for helping folks make these cookie-cutter sites more attractive.
Trackbacks