Tuesday , 22 July 2014
Home | Articles | Wordpress | Add a Custom Logo to the WordPress Login Screen
Add a Custom Logo to the WordPress Login Screen

Add a Custom Logo to the WordPress Login Screen

There are many things about WordPress that make life easy… and a few that are a real pain in the butt.  One of the pains is the login form’s logo and url.  If you are like me, you want to brand your sites and doing so gives the site that extra touch of personalization.  Not to mention, if you are designing a site for a customer, you don’t want a big fat logo for WordPress linking to the WordPress.org site on the login form. 

By simply overwriting the logo-login image in your WordPress wp-admin/images/ folder you risk having the original WordPress image restored every time you update your installation.

The bad news is that there is no way to do this from your WordPress dashboard, the good news is that you can do this easily by editing your theme’s functions.php file.

1. create an image with the dimensions 326 wide by 67 high, name it logo-login.gif and drop it into your theme’s images folder.
1. edit your functions.php file and add the following code between the <?php and ?>

// --------------------------------------------------------------------------
// Start Custom Login Logo
// --------------------------------------------------------------------------
	function my_custom_login_logo() {
	    echo '';
	}

	add_action('login_head', 'my_custom_login_logo');
// --------------------------------------------------------------------------
// End Custom Login Logo
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// Start Custom Login Logo URL
// --------------------------------------------------------------------------
	function change_wp_login_url() {
	echo bloginfo('url');
	}

	function change_wp_login_title() {
	echo get_option('blogname');
	}

	add_filter('login_headerurl', 'change_wp_login_url');
	add_filter('login_headertitle', 'change_wp_login_title');
// --------------------------------------------------------------------------
// End Custom Login Logo URL
// --------------------------------------------------------------------------

Note: These functions are not of my own creation, simply things I have found along the way.  If you are the author of this function, please let me know so I can properly credit you with your work!

About Joe DiFiglia

I have always had a passion for everything computing. In early 2000, I decided to take my passion to the web. Thus, C.O.D. was born. Through the years we have made many great friends at C.O.D. and hope to continue our journey for years to come.