Ben Eberle
Web Design &


Comments Closed

Share this post

Customizing the WordPress Backend

A custom login page is a really nice touch. There are plugins out there that can do this, but why bother when all you need to do is to drop this into¬†your theme’s functions.php file. It will override the default WordPress login css styles and allow you to customize the logo and background. Totally fresh.


// Customize login styles

function bme_custom_login_styles(){
	<style type="text/css">
		/* Change login page background - make sure image path is valid */
		   background: #68686B url("<?php echo get_stylesheet_directory_uri(); ?>/images/login-background.jpg") 50% -250px no-repeat fixed !important; 

		/* Custom logo - make sure image path is valid */
		body.login h1 a { 
			background: url("<?php echo get_stylesheet_directory_uri(); ?>/images/logo-login.png") no-repeat top center; 
			background-size: 106px 106px;
		#login { padding: 10px;}
		/* Change link color & shadow if needed */
		#loginform {
			border: none; 
			-webkit-box-shadow: none; 
			box-shadow: none;
		.login #nav a, .login #backtoblog a { 
			color: #999!important; 
		.login #nav a:hover, 
		.login #backtoblog a:hover {
			color: #fff!important; 
			text-shadow:#000 1px 1px 0; 

		/* Add shadow to message and login boxes */
		.login form, p.message {
			-moz-box-shadow: rgba(0,0,0,0.5) 0 2px 8px;
			-webkit-box-shadow: rgba(0,0,0,0.5) 0 2px 8px;
			box-shadow: rgba(0,0,0,0.5) 0 2px 8px;

add_action('login_head', 'bme_custom_login_styles');