Last active
May 8, 2023 19:51
-
-
Save JamesVanWaza/0b067218d69b444dc307b4bbbbd333a1 to your computer and use it in GitHub Desktop.
Wordpress: Login Page Change
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 | |
function my_login_logo() { ?> | |
<style> | |
#login h1 a, .login h1 a { | |
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/site-login-logo.png); | |
height:65px; | |
width:320px; | |
background-size: 320px 65px; | |
background-repeat: no-repeat; | |
padding-bottom: 30px; | |
} | |
</style> | |
<?php } | |
add_action( 'login_enqueue_scripts', 'my_login_logo' ); | |
function my_login_logo_url() { | |
return home_url(); | |
} | |
add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
function my_login_stylesheet() { | |
wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' ); | |
wp_enqueue_script( 'custom-login', get_stylesheet_directory_uri() . '/style-login.js' ); | |
} | |
add_action( 'login_enqueue_scripts', 'my_login_stylesheet' ); | |
function my_login_logo_url_title() { | |
return 'Your Site Name and Info'; | |
} | |
add_filter( 'login_headertext', 'my_login_logo_url_title' ); |
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
.login h1 a { | |
background-image: url('../../../images/w-logo-blue.png?ver=20131202'); | |
background-image: none, url('../../../images/wordpress-logo.svg?ver=20131107'); | |
background-size: 80px 80px; | |
background-position: center top; | |
background-repeat: no-repeat; | |
color: #999; | |
height: 80px; | |
font-size: 20px; | |
font-weight: normal; | |
line-height: 1.3em; | |
margin: 0 auto 25px; | |
padding: 0; | |
text-decoration: none; | |
width: 80px; | |
text-indent: -9999px; | |
outline: none; | |
overflow: hidden; | |
display: block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment