How to Customize Login Screen without plugin


This function is handy when we develop a customize solution to sell. This simple tricks  is going to change the background login screen logo according to your requirement.

Customize Login Screen in WordPress

How to change Login screen in WordPress

The whole process is divided into tiny three steps, In our first step, we are going to replace default WordPress logo with our very own Custom Login Logo screen logo.

Remember this custom Login Logo must be inside your theme’s Image folder with name as listed in the below code

Step 1 : Change Default WordPress Login screen Logo

Just open your functions.php file and copy paste the following code


function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/custom-login-logo.gif) !important; }
</style>';
}

Step 2 : Function to Change Custom Login Screen URL

Step 1 will only replace default login logo but the URL attached with that logo will still point to WordPress.org, Now its time to replace this with our very Own blog/site URL.

Copy paste the below code inside your function.php file

function change_wp_login_url() {
echo bloginfo('url');
}

Step 3 :Function to Change Login Screen Title

Now its time to change the title of your Login screen to something that will suite to your website. Again copy and paste the following code


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

Step 4:  Its Show Time

Just add the below code to actually direct WordPress engine to make the necessary changes


add_filter('login_headerurl', 'change_wp_login_url');
add_filter('login_headertitle', 'change_wp_login_title');
add_action('login_head', 'my_custom_login_logo');

Nothing else, just go back and enjoy your customize login screen.




2 Brilliant Comments - Join Discussion Now!

  1. Geek says:

    This looks really nice. I am going to try this in my spare time. I hate to use too many wordpress plugins and it is good to know that I can do things without using so many plugins.

    • rakesh says:

      and do not forget to update us about your experience of this code. Keep in touch geek.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>