Skip to content

Instantly share code, notes, and snippets.

@avillegasn
Last active February 19, 2019 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save avillegasn/b2c3e1828122c2f8d5ec15a620a1078c to your computer and use it in GitHub Desktop.
Save avillegasn/b2c3e1828122c2f8d5ec15a620a1078c to your computer and use it in GitHub Desktop.
How to add a custom logo in WordPress login page
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