It’s once again WooCommerce customization time! As in the past 2 episodes (open external product in new tab and show shipping rates @ single product), I’m featuring snippets and code I personally use on my Sicilian marketplace/dropshipping business called A Piece of Sicily.
Today, I’ll quickly show you how to personalize the default WordPress login/logged out page with your custom logo and link as opposed to showing the WordPress logo and the wordpress.org image link, which to be completely honest, shouldn’t be there in the first place!
So, enjoy! You can see the live result here: https://www.apieceofsicily.com/en/login/?loggedout=true
PHP / CSS Snippet: Replace WordPress Logo With Custom Logo @ WordPress Login Page
/**
* @snippet Replace Logo - WordPress wp-login page
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 5.1
* @community https://businessbloomer.com/club/
*/
add_action( 'login_enqueue_scripts', 'bbloomer_login_logo' );
function bbloomer_login_logo() {
?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url(/wp-content/uploads/2020/03/PNG-RGB-1536x830.png);
height: 150px;
width: 250px;
background-size: contain;
background-repeat: no-repeat;
background-color: transparent;
}
</style>
<?php
}
add_filter( 'login_headerurl', 'bbloomer_login_logo_link' );
function bbloomer_login_logo_link( $url ) {
return home_url( '/' );
}
Hey Rodolfo
Thanks a lot for all the tips you share, it is just awesome!
One question about the code snippet you shared
How do I make the return to a custom URL instead of Home_url ?
Thanks in advance
You can always specify the URL:
Thank Rodolfo, Every time I learn something from you that makes my WooCommerce experience better!
Cheers!
Thank you, works as expected – WordPress 5.8
Awesome