WordPress login page: Change the default WP logo and link | 2024

EncodeMore
/* -----------------------------------------------------------
Add these code to functions.php
-----------------------------------------------------------
/*Changes the main Login page url link*/
function wp_login_page_URL( $url ) {
$url = home_url( '/' );
return $url;
}
add_filter( 'login_headerurl', 'wp_login_page_URL' );
-----------------------------------------------------------
/*Replaces the default WordPress Logo*/
function add_logo_Login_page() {
echo '<style>.login h1 a {
background-repeat: no-repeat;
background-image: url(https://yourimagelink);
background-position: center center;
background-size: contain !important;
width: 100% !important;
}
</style>';
}
add_action( 'login_head', 'add_logo_Login_page' ); */


/*================================================
EncodeMore: Change Login Logo and URL
================================================*/

function own_login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(https://YOURLOGOHERE.jpg);
        height:200px;
        width:auto;
        background-size: 200px auto;
        background-repeat: no-repeat;
        padding-bottom: 10px;
        }
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'own_login_logo' );

function own_login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'own_login_logo_url' );

Share This Article
Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *