Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Wordpress - change login image, login url and url title
// add this to your themes functions.php file
// change login image
add_action("login_head", "my_login_head");
function my_login_head() {
echo "
<style>
body.login #login h1 a {
background: url('".get_bloginfo('template_url')."/assets/img/image-name.png') no-repeat scroll center top transparent;
height: 59px;
}
</style>
";
}
// Change title for login screen
add_filter('login_headertitle', create_function(false,"return 'URL Title';"));
// change url for login screen
add_filter('login_headerurl', create_function(false,"return home_url();"));
// change login image
add_action("login_head", "my_login_head");
function my_login_head() {
echo "
<style>
body.login #login h1 a {
background: url('".get_bloginfo('template_url')."/assets/img/image-name.png') no-repeat scroll center top transparent;
height: 59px;
}
</style>
";
}
// Change title for login screen
add_filter('login_headertitle', create_function(false,"return 'URL Title';"));
// change url for login screen
add_filter('login_headerurl', create_function(false,"return home_url();"));
@GrandRapidsWeb

I used this snippet to change the url in my login logo. But I wanted to set it to a different site then the homepage for that particular site. So I made this tweak.

// change url for login screen
function my_login_logo_url() {
return 'http://mywebsite.com';
}
add_filter('login_headerurl', 'my_login_logo_url' );

@sallysqueak

Hey

I tried to do this, and added it at the end of all my code already in my functions.php file, but it made the following appear at the top of my website;

// change login image add_action("login_head", "my_login_head"); function my_login_head() { echo " "; } // Change title for login screen add_filter('login_headertitle', create_function(false,"return 'URL Title';")); // change url for login screen add_filter('login_headerurl', create_function(false,"return home_url();"));

Did I do something wrong? I had to remove it without even checking whether it fixed my image problem because it looked bad on my live site :(

It would be great to know how to make this work if you could help :)

Thanks

@sallysqueak

Ok, I got it to stop making the text appear at the top, but the code doesn't do anything it seems, I just have the wordpress logo still on the login screen :( I changed /assets/img/image-name.png to the url of the image I want, is that all I need to do or is this wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.