Want branded login page? Add custom logo with a few lines of code – no plugin needed.
Add to functions.php:
function custom_login_logo() {
echo '<style type="text/css">
#login h1 a {
background-image: url(' . get_stylesheet_directory_uri() . '/images/logo.png);
background-size: contain;
width: 300px;
height: 100px;
}
</style>';
}
add_action('login_enqueue_scripts', 'custom_login_logo');
Change Logo URL:
function custom_login_url() {
return home_url();
}
add_filter('login_headerurl', 'custom_login_url');
Upload logo.png to wp-content/themes/your-theme/images/
Professional branded login page in 2 minutes!
