// 1. Change Login Logo URL to Homepage
add_filter( 'login_headerurl', function() {
return home_url();
} );
// 2. Change Login Logo Tooltip Title
add_filter( 'login_headertext', function() {
return get_bloginfo( 'name' );
} );
// 3. Inject Custom Logo CSS
add_action( 'login_enqueue_scripts', function() {
$custom_logo_id = get_theme_mod( 'custom_logo' );
$logo_url = $custom_logo_id ? wp_get_attachment_image_url( $custom_logo_id, 'medium' ) : '';
if ( ! $logo_url ) return;
?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url('<?php echo esc_url( $logo_url ); ?>');
background-size: contain;
background-position: center;
background-repeat: no-repeat;
width: 100%;
height: 80px;
margin-bottom: 20px;
}
</style>
<?php
} );