WordPress: How to change the login logo and its URL without a plugin
By default, on the login page, the logo is WordPress logo and it links to WordPress.org home page. This can make your site look less professional, especially it has multiple users.
Luckily, we can easily custom the WordPress login page. Add the pieces of code below to your functions.php:
// replace the WordPress.org url by your homepage url
add_filter('login_headerurl', 'my_login_header_url');
function my_login_header_url()
{
return esc_url(site_url('/'));
}
// remove WordPress default logo
add_action('login_enqueue_scripts', 'my_login_script');
function my_login_script()
{
?>
<style type="text/css">
body.login div#login h1 a {
background-image: none;
width: 300px;
text-indent: 0;
font-size: 35px;
font-style: italic;
}
</style>
<?php
}
// use your site name as the login page logo
add_filter('login_headertext', 'my_login_header_text');
function my_login_header_text()
{
return get_bloginfo('name');
}
Welcome to KINDACODE. Have a nice day and code well!
navigate