Skip to content

Instantly share code, notes, and snippets.

@utopianfool
Created September 22, 2020 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utopianfool/d5a52fdaf975503f1609b2f30d4f958d to your computer and use it in GitHub Desktop.
Save utopianfool/d5a52fdaf975503f1609b2f30d4f958d to your computer and use it in GitHub Desktop.
WordPress Custom Login Logo Function
<?php
/**
* Add custom logo to login
*/
function custom_login_logo() { ?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/login-logo.png);
height:65px;
width:320px;
background-size: 320px 65px;
background-repeat: no-repeat;
padding-bottom: 30px;
}
body.login form[id="loginform"] {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/home-bg.png);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
body.login form[id="loginform"] label {
color: #fff;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'custom_login_logo' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment