If you want to change the way your login WordPress page looks, this is the easiest way to do it. This code snippet adds a stylesheet to your login page and you can style it any way you like and moreover change the default WordPress logo link (leading to wordpress.org) and its title text to whatever you want. Simply edit your functions.php theme file and add the following code.
function custom_loginpage_logo_link($url)
{
// Return a url; in this case the homepage url of wordpress
return get_bloginfo('wpurl');
}
function custom_loginpage_logo_title($message)
{
// Return title text for the logo to replace 'wordpress'; in this case, the blog name.
return get_bloginfo('name');
}
function custom_loginpage_head()
{
/* Add a stylesheet to the login page; add your styling in here, for example to change the logo use something like:
#login h1 a {
background:url(images/logo.jpg) no-repeat top;
}
*/
$stylesheet_uri = get_bloginfo('template_url')."/css/login.css";
echo '<link rel="stylesheet" href="'.$stylesheet_uri.'" type="text/css" media="screen" />';
}
// Hook in
add_filter("login_headerurl","custom_loginpage_logo_link");
add_filter("login_headertitle","custom_loginpage_logo_title");
add_action("login_head","custom_loginpage_head");
Code explanation
Using the WordPress hooks on the login page (custom_loginpage_logo_link, custom_loginpage_logo_title, custom_loginpage_head) we insert our code and modify the default WordPress title text and link to whatever we prefer.
Source: http://blue-anvil.com/archives/wordpress-snippet-2-style-the-login-page/
Tags: WordPress Login Page
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your
post to my blog?
Yes, no problem, just mention the sources!