Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save simonlk/3998938 to your computer and use it in GitHub Desktop.
Save simonlk/3998938 to your computer and use it in GitHub Desktop.
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();"));
@sallysqueak
Copy link

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