Skip to content

Instantly share code, notes, and snippets.

@joshhartman
Created March 13, 2020 20:17
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 joshhartman/eedefb25c92e529f3fe04ce4336992f0 to your computer and use it in GitHub Desktop.
Save joshhartman/eedefb25c92e529f3fe04ce4336992f0 to your computer and use it in GitHub Desktop.
WordPress Admin Login Custom Styling
<?php
function my_custom_login_styles() { ?>
<style type="text/css">
body.login {
background-color: #114892 !important;
}
body.login div#login h1 a {
background-image: url(<?php echo get_stylesheet_directory_uri() ?>/images/site-login-logo.png);
padding-bottom: 15px;
background-size: auto;
width: auto;
}
.login.login #nav a, .login.login #backtoblog a {
color: #fff;
text-shadow: 0 1px 2px #000;
}
.login h1 a {
width: auto;
-webkit-background-size: auto;
background-size: auto;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'my_custom_login_styles' );
function my_custom_login_logo_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_custom_login_logo_url' );
function my_custom_login_logo_url_title() {
return get_bloginfo('name');
}
add_filter( 'login_headertitle', 'my_custom_login_logo_url_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment