Skip to content

Instantly share code, notes, and snippets.

@anythinggraphic
Last active January 29, 2017 03:41
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 anythinggraphic/dfd977fc2c3a7976fbf89340641b6be5 to your computer and use it in GitHub Desktop.
Save anythinggraphic/dfd977fc2c3a7976fbf89340641b6be5 to your computer and use it in GitHub Desktop.
Change the WordPress admin login logo and image URL
<?php
/* @link https://anythinggraphic.net/change-wordpress-admin-login-logo-image-url/
/* Change login logo and link
----------------------------------------------------------------------------------------*/
add_filter('login_headerurl','ag_login_link');
function ag_login_link() {
return home_url();
}
add_action( 'login_enqueue_scripts', 'ag_login_logo' );
function ag_login_logo() { ?>
<style type="text/css">
#login {
width: 364px;
}
#login h1 {
background: transparent;
padding: 20px;
}
#login h1 a {
background: url(<?php echo get_stylesheet_directory_uri(); ?>/images/anything-graphic-logo.svg) no-repeat center center;
background-size: 276px 60px;
height: 60px;
margin: 0 auto;
width: 276px;
}
.login form .input, .login input[type="text"] {
font-size: 22px;
font-weight: 100;
margin: 2px 6px 16px 0;
padding: 5px 10px;
}
input[type="checkbox"], input[type="color"], input[type="date"], input[type="datetime-local"], input[type="datetime"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="radio"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], select, textarea {
border: 1px solid #ddd;
}
input[type="checkbox"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime-local"]:focus, input[type="datetime"]:focus, input[type="email"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="radio"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, select:focus, textarea:focus {
border: 1px solid #ddd;
box-shadow: 0 0 2px rgba(0, 0, 0, .5);
}
.wp-core-ui .button-group.button-large .button, .wp-core-ui .button.button-large {
background: #229bee;
border: 0;
border-radius: 0;
box-shadow: none;
font-weight: 700;
height: 30px;
line-height: 28px;
padding: 1px 12px 2px;
text-shadow: none;
text-transform: uppercase;
}
.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover {
color: #229bee;
}
.login .message {
border-left-color: #333;
}
</style>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment