In this post, we will show you:
(1) How to replace the WordPress logo with your website logo on the login page.
(2) How to replace WordPress URL with your website URL on the login page.
(3) And how to replace URL title with your custom title on the login page.
(1) Replace WordPress logo with your website logo on the login page.
To Change the default logo of WordPress and add your website logo create a function
/* Change the logo */ function phpglossary_addlogo() { echo '<style type="text/css"> h1 a {background-image: url( here will be url of your website logo ) !important; } </style>'; }
now add created function ‘phpglossary_addlogo’ to a filter hook :
add_action('login_head', 'phpglossary_addlogo');
now just copy & paste above code in your theme’s functions.php file.
(2) Replace WordPress URL with your website URL on the login page.
To Change the default link of WordPress and add your website link create a function
function phpglossary_logo_url() { return home_url(); }
and add created function ‘phpglossary_logo_url’ to a filter hook :
add_action('login_headerurl', 'phpglossary_logo_url');
and paste above code in the functions.php file of your WordPress theme.
(3) Replace URL title with your custom title on the login page.
To Change the default title of WordPress and add your title create a custom function
function phpglossary_login_title() { return 'Here will be your title'; }
and add declared function ‘phpglossary_login_title’ to a filter hook :
add_filter('login_headertitle', 'phpglossary_login_title');
The complete code is given below :
<?php /* Calling default head url and head title filter */ add_filter( 'login_headerurl', 'phpglossary_logo_url' ); add_filter('login_headertitle', 'phpglossary_login_title'); add_action('login_head', 'phpglossary_addlogo'); /* Change the logo */ function phpglossary_addlogo() { echo '<style type="text/css"> h1 a {background-image: url( here will be url of your website logo ) !important; } </style>'; } /* Change the logo url */ function phpglossary_logo_url() { return home_url(); } /* Change the logo hover title */ function phpglossary_login_title() { return 'Powered By www.dineshsharma.in'; } ?>
To change the default WordPress logo, link and title on mouse hover on login page just copy and paste above code in your WordPress themes’s functions.php file, refresh your wordpress login page and see the changes.