WordPress: Style wp-login.php page

If your site is open to user registrations and you want to add your own branding to the default wp-login.php it is actually easier than you think! Simply add the following code to your functions.php file:

function add_login_stylesheet() {
	echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login.css" />';
}
add_action('login_head', 'add_login_stylesheet');

So now all you need to do is create a stylesheet called login.css in your template’s theme folder and add in your custom css. For example, to change the logo from the default wordpress logo, simply add the following css to your stylesheet (remember to change the path to your image):

.login h1 a{background:url(path/to/image.png);}

Also, you may notice that the wordpress logo on the login page links to wordpress.org, you can change this to your site’s URL by adding the following code to your functions.php file:

function my_custom_login_url() {
  return site_url();
}
add_filter( 'login_headerurl', 'my_custom_login_url');

You can also change the url of the WordPress login page from the default http://yourdomain.com/wp-login.php to something that looks a bit nicer such as: http://yourdomain.com/login. Simply add this code to the top of your .htaccess file:

RewriteRule ^login$ http://YOUR_SITE.com/wp-login.php [NC,L]
Free Graphics, Icons, Tutorials
Free Graphics Free Christmas Vector Icon Graphics Pack 2017Free Fitness Vector Icons Graphics PackFree Camping Vector Graphics PackFree Summer Graphics PackFree File Icon PackFree Fast Food Vector Graphics
Sharing is caring...
Like & Follow
Share the love, share this page! Facebook Twitter Google Digg Reddit LinkedIn Pinterest Email
Close [X]
The Web Taylor
1000 Lakeside North Harbour Portsmouth, Hampshire PO6 3EN
02392 123358