WORDPRESS - Oxygen - toolset

Custom WordPress login logo

Author: Aleš Sýkora, 15. 1. 2021

Would you like to have your brand logo instead of default WordPress logo at your login page? Use this snippet in your custom funcionality plugin or in code snippets etc.

This snippet changes the default logo and add link to the homepage. It also add custom Title for mouse hover over the logo.

<?php
function login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(https://www.yourlogourl.com/); /*logo image URL*/
}
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'login_logo' );

function login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'login_logo_url' );
function login_logo_url_title() {
    return 'Your website name'; //Title for your logo image
}
add_filter( 'login_headertitle', 'login_logo_url_title' );
?>