Aleš Sýkora / November 28, 2023 / 0 comments
Custom WordPress login logo
min read / Advanced Scripts, Custom Code, Plugins, WordPress / Share on: Twitter, LinkedIn, Facebook
Post summary: 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. I am using the Advanced Scripts plugin. This snippet changes the default logo and add link to the homepage. It also add custom Title for…
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. I am using the Advanced Scripts plugin.
This snippet changes the default logo and add link to the homepage. It also add custom Title for mouse hover over the logo.
UPDATE 10.03.2022
login_headertitle is deprecated. Changed to login_headertext.
<?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_headertext', 'login_logo_url_title' );
?>
Fuel my passion for writing with a beer🍺
Your support not only makes me drunk but also greatly motivates me to continue creating content that helps. Cheers to more discoveries and shared success. 🍻