Monday, July 8, 2013

How to customize login page of your WordPress website

I will show you on this tutorial how to to customize default login page of your WordPress website.
don't forget to add php code below in functions;php file of your active template.

Change the Logo of login page
Is the WordPress logo by default, this changes the file path of that image. Change file path and file name to your own needs.
function custom_login_logo() {
echo '<style type="text/css">h1 a { background: url('.get_bloginfo('template_directory').'http://cdn.css-tricks.com/images/logo-login.gif) 50% 50% no-repeat !important; }</style>';
}
add_action('login_head', 'custom_login_logo');


Change the URL of logo
... of where clicking that logo goes. By default it goes to WordPress.org, this will change it to your own homepage.
function change_wp_login_url() {
return bloginfo('url');
}
add_filter('login_headerurl', 'change_wp_login_url');


Change the Title of logo picture
That is, change the title attribute of the image you just replaced. This changes it to the name of your blog in the settings.
function change_wp_login_title() {
return get_option('blogname');
}
add_filter('login_headertitle', 'change_wp_login_title');

Disqus Comments