Created
November 2, 2012 05:44
-
-
Save simonlk/3998938 to your computer and use it in GitHub Desktop.
Wordpress - change login image, login url and url title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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();")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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();")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?