UK Sales: 0800 035 6364 | sales@2020media.com | We'll Call You

This snippet will change your WordPress login page so that you can change the logo away from WordPress, and also change the default logo link (to wordpress.org) and title text to something of your choosing.

 

The following code must be added to the functions.php file of your template.

 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 my_login_head() {
 	echo "
	 < style>          // remove the space between < and style.
 	body.login #login h1 a {
 		background: url('http://www.mydomain.co.uk/wp-content/uploads/mypath/mylogoimage.jpg') no-repeat scroll center top transparent;
 		height: 95px;   // change this to match your image.
 		width: 400px;   // change this to match your image.
 	}
 	< /style>    // remove the space between < and /style.
 	";
 }
 // Hook in
 add_filter("login_headerurl","custom_loginpage_logo_link");
 add_filter("login_headertitle","custom_loginpage_logo_title");
 add_action("login_head", "my_login_head");
 

Notes

You may need to make the functions.php file editable first, using your FTP client. If you uploaded the template from within WordPress then it should be fine.

The image URL should be a full url including http://

You can put the code anywhere in the functions.php, just make sure it is between the code goes between the php begin and end marks.

You can see an example at www.hairdressing.co.uk.

Attribution

This document is referenced from blue-anvil.com.

2020Media is a leading provider of small business Wi-Fi hotspots. If you want to offer free Wi-Fi to your customers or users, our service could be exactly what you are looking for. Our Hotspots are managed in the cloud, ultra-reliable and give you loads of information about behaviour patterns of your users. Read More   Read more...
2020Media introduces Moodle Hosting - UK servers and UK Moodle experts setup your site ready to use. Read more...
Special Offer for Longer Registration Periods Register or renew a .com, .net or .org domain name for 5 years we'll include 1 year free*. Read more...
2020Media is now offering zero-click installation of the popular TYPO3 content management system. Read more...

Our blog is regularly updated with news, tips and industry opinion.

Clients

  • AggieWestons
  • baker-and-mckenzie
  • arts-council-england
  • Big Finish
  • barratt-developments-logo
  • City-of-Lincoln-council-logo
  • brora-logo
  • DenisMacShane
  • Construction-Industry-Council
  • colchester