Created
September 22, 2020 06:06
-
-
Save utopianfool/d5a52fdaf975503f1609b2f30d4f958d to your computer and use it in GitHub Desktop.
WordPress Custom Login Logo Function
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
<?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