How To Change The Logo Image and Link on WordPress Login Page in an Oxygen Website

Published: December 14, 2021,  
Posted in: , , ,  

Clients love seeing their logo when they login to their site.

With the help of some wise people in the WPDevDesign Facebook Group, the following code snippet lets you easily change the standard WordPress logo and link on the login page.

From this
To this

Add the following code snippet and set to run everywhere.

You only need to change the URL to the logo you want to show and adjust the width, height and background size to suit the aspect ratio of the logo.

function login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(https://yourwebsite.com/wp-content/uploads/2021/12/logo-file.png);
			background-position: center center;
			height: 90px;
			width: 90px;
			background-size: 90px;
			object-fit: cover;
			
}
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'login_logo' );

//Custom logo URL

function login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'login_logo_url' );
function login_logo_url_title() {
    return 'Link title';
}
add_filter( 'login_headertitle', 'login_logo_url_title' );

Thats it! I hope you find this useful.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get Notified Of New Posts
Copyright © 2022 All Rights Reserved  |  By Itchy Fingers Design
twitterfacebookenvelopelinkedinxinglong-arrow-leftlong-arrow-rightpaper-planepinterest-pwhatsappcommentingchevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram