Customize the logo of your WordPress login page : second method


Want to the logo of admin login page? This is possible by inserting a few lines of code in the functions.php file of your theme. Finally, a website that is more professional and close to your brand.

 

The topic is named “second method” ; because previously we described another similar method, which does not require the use of CSS file.  Therefore, this method can be exploited to a login page absolutely looking like your theme.

The WordPress default logo is present on your login page when accessed through the classic URL.

That is not very professional, you can replace it with one of your choice by interfering with your theme.

In fact, updates of WordPress will have no impact on your new logo; you will actually replace the default file.

Log in first in your WordPress admin, open the Appearance menu and then click Editor.

On the right side of your screen, open the functions.php file.

Note: You can edit each file in your theme using a PHP editor for Mac OS X as Coda, Notepad + + for Windows or even Dreamweaver. The big advantage is being able to quickly undo the changes and enjoy editing features and uploaded via FTP.

 

Editing the file functions.php

At the beginning or end of file, insert the following lines of code:

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

 

Do not leave lines blank if you place it at the end of file.

The third line of code adds a custom style sheet loading the login page of WordPress. For example, we noted the URL of the stylesheet contained by default in any theme.

So we must either:

  • Add CSS needed for the login page;
  • Or create a new CSS style sheet that contains just the styles unique to the login page;

 

We will hold the second solution for optimal results – although, personally, we have adopted the first solution.


 

Create a style sheet

Using a text editor, create a new file named login . css.

Save it in / wp-content/theme/Your_Theme/ in your WordPress site.

Then add the following lines of code:

# Login h1 a {-image: url ("http://YOURSITE.com/wp-content/themes/YOUR_THEME/images/your-logo.png")! Important;}

A file must exist, whose name must match the one you see in the code – in this case, logo-perso.png.

Of course, feel to change this URL if your logo is not located in the theme folder.

To save your custom logo to your server, use an FTP client like FileZilla or Cyberduck.

 

Edit and see the outcome

 

If you have not encountered any trouble, here is the result of a custom login page with custom logo:

 

Customize the logo of your WordPress login page

 

Choose an image of 320 by 80 pixels (maximum).

Among the very common mistakes, you may get a blank page.  Just make sure that there is no white line is present at end of file functions.php .

Unlike many tutorials on the subject, you should not get problems redirect to the WordPress admin page located at wp-admin.

Very important from a marketing perspective, of the logo is only a first step in creating your brand. Using your stylesheet, you can change all of this page and go further into what is commonly called branding.

 

Note: If you edit the CSS to set the background, login box style etc, you will get a totally different looking (and matching with your website’s theme) login page.

 

Signature


0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
About Abhishek

Abhishek Ghosh is an Orthopedic Surgeon, Inventor with 216 Patents, Current editor of The Customize Windows Media Group. You can follow and know more about Dr. +Abhishek Ghosh on Google Plus and follow on Twitter as @AbhishekCTRL.

Speak Your Mind

*