
WordPress login logo looks nice, but sometimes you may want to change it, for example when building a site for a client. In that case, you can use a plugin, or simply take advantage of this cool hack.

WordPress login logo looks nice, but sometimes you may want to change it, for example when building a site for a client. In that case, you can use a plugin, or simply take advantage of this cool hack.
Nothing hard with this recipe. The only thing you have to do is to copy the following piece of code, and paste it on your functions.php file:
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/custom-login-logo.gif) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
This hack has been submitted by Rami. Thanks for your contribution!
8 Responses
This is one of my favourite, simple WordPress hacks.
It does not work properly … the image does not fit correctly despite being a proper wordpress login screen !
This is very simple. Kill plugins.
Maybe citing the original source would be better: http://primegap.net/2011/01/26/wordpress-quick-tip-custom-wp-login-php-logo-url-without-hacks/
Nevermind, I just saw that the original post on the contributor’s site is from 2009 (sorry I didn’t check and I cannot read hebraic).
My bad. Interestingly we came basically to the same code! I just don’t remember where I found the documentation to create this hack, so maybe we drew from the same sources.
Our quick tip has also another function to add a custom url to the custom logo, if you need to.
Hi there. I know there is something in the codex regarding this. I actually edited the article with the code mentioned above this past week.
If you’d like the source, I could look.
This code works fine.
I tested it on a Twenty Eleven Child Theme 25/12/2011
youll need url edited also and mouse over powered by wordpress
-=-=-=
function my_custom_login_logo() {
echo ‘
h1 a { background-image:url(‘.get_bloginfo(‘template_directory’).’/images/logo-login.png) !important; }
‘;
}
add_action(‘login_head’, ‘my_custom_login_logo’);
function my_custom_login_url() {
return site_url();
}
add_filter( ‘login_headerurl’, ‘my_custom_login_url’, 10, 4 );
function login_header_title()
{
return get_bloginfo(‘name’);
}
add_filter(“login_headertitle”,”login_header_title”);
Trackbacks: