
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!
36 Responses
I’m going to do this on all of my client sites – it’s one of those little extras that’s well worth it!
That’s a very cool idea. Will that get replaced when you update your wordpress core?
@Nicholas Cardot : Not at all, this is the very good point of this method
How about if I wanted to change the title or link attribute of the custom logo, instead of the default “Powered by Wordpress” and link to wordpress.org?
Is that possible through the functions method?
This is brilliant, i’ve been looking for something like this.
Cheers!
It doesn’t appear to change the link though (it still links to wordpress.org)… any way to change that too?
Good little recipe and great for premium theme providers and business client developed themes. Thanks for posting it
I have the same question as Matt and p, how do we change the link?
Bit pointless in changing the logo if it links to wordpess.org imo!
I like the idea… it will be like my own login
@p, @Thomas:
Here’s how to change the Link & Title attributes for a custom logo.
//Custom Login Screen
function change_wp_login_url() {
echo bloginfo(‘url’);
}
function change_wp_login_title() {
echo get_option(‘blogname’);
}
add_filter(‘login_headerurl’, ‘change_wp_login_url’);
add_filter(‘login_headertitle’, ‘change_wp_login_title’);
Put that in your
functions.phpfileCheers Matt, had a feeling there was a hook somewhere! Makes this post a whole lot more useful now!
Happy Holidays.
that’s a cool little trick, thanks.
I just wrote an article a few days ago on how to change the look using a plugin (which works really well). But this is a great alternative for those not wanting to mess with any plugins.
This is perfect when combined with Matt’s code to change URL and Title.
I’d love to see this as a simple plugin with input fields for the image location url and the link of the image… anyone?
I was looking for this for a long time thanks for the tip
excellent tip!! thanks for sharing!
Many thanks, this small things makes a big difference wen presenting the site to a customer
I’m getting this warning:
Warning: Cannot modify header information – headers already sent by (output started at /home/look/public_html/wp/wp-content/themes/wp-theme/functions.php:61) in /home/look/public_html/wp/wp-login.php on line 290
Warning: Cannot modify header information – headers already sent by (output started at /home/look/public_html/wp/wp-content/themes/wp-theme/functions.php:61) in /home/look/public_html/wp/wp-login.php on line 302
My custom logo appears but that appears as well.
What did I do wrong?
I have solved my problem. It seems that this is a common problem when editing the functions file.
Make sure there is absolutely no white space after the close of your php tag. I had a few extra spaces (line 290 was just a blank line). I deleted the blank stuff and everything worked perfectly.
Very neat piece of code creating a big impression! Great tip!
Cool tip that seems very easy to do. I am amazed at how much can be modified using functions.php.
HEY could anyone tell me if i upgrade to any other 2.x wordpress version ,would my customizations get wiped off?
As in, all efforts in vain?
Please let me know
Trackbacks: