-
-
Save admaesmo/0d9bb2747b756c60f46449af4ec82a03 to your computer and use it in GitHub Desktop.
How to add a custom logo in WordPress login page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_login_logo() { ?> | |
<style type="text/css"> | |
#login h1 a, .login h1 a { | |
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/img/nelio-icon.png); | |
height: 84px; | |
width: 84px; | |
background-size: cover; | |
background-repeat: no-repeat; | |
} | |
</style> | |
<?php }//end my_login_logo() | |
add_action( 'login_enqueue_scripts', 'my_login_logo' ); | |
function my_login_logo_url() { | |
return home_url(); | |
}//end my_login_logo_url() | |
add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
function my_login_logo_url_title() { | |
return 'Nelio Software'; | |
}//end my_login_logo_url_title() | |
add_filter( 'login_headertitle', 'my_login_logo_url_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment