Wordpress - change login image, login url and url title

  • Download Gist
Wordpress - change login image login url and url title
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// 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();"));
Wordpress - change login image, login url and url title
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// 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();"));

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' );

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.