Skip to content

Instantly share code, notes, and snippets.

@JamesVanWaza
Last active May 8, 2023 19:51
Show Gist options
  • Save JamesVanWaza/0b067218d69b444dc307b4bbbbd333a1 to your computer and use it in GitHub Desktop.
Save JamesVanWaza/0b067218d69b444dc307b4bbbbd333a1 to your computer and use it in GitHub Desktop.
Wordpress: Login Page Change
<?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' );
.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