Skip to content

Instantly share code, notes, and snippets.

@andornagy
Last active January 1, 2016 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andornagy/8149867 to your computer and use it in GitHub Desktop.
Save andornagy/8149867 to your computer and use it in GitHub Desktop.
<?php
function my_login_logo_url() {
return get_bloginfo( 'url' );
}
add_filter( 'login_headerurl', 'my_login_logo_url' );
function my_login_logo_url_title() {
return 'Your Site Name and Info';
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );
/*
* Our Custom Login Page Stylesheet
*/
/* The background
* This can be image or color, note the !important at the end.
*/
body {
background-color:#555 !important;
}
/* Title image (The "WordPress Logo") Mus use image as a Background!
* Remember to update the height and width your image's dimensions
*/
#login h1 a {
background:url(login-bg.png) 0 0 no-repeat;
width:300px;
height:104px;
}
/* The Form ( The login box )
* Background color, border, shadow, etc..
*/
#login form {
background-color:#333;
}
/* The Login Fields
* Username and Password
*/
#login .input {
background-color:#ccc;
}
/* The Labels
* The text above the fields
*/
#login label {
color:#fff;
font-size:15px;
font-size:1.5rem;
}
/*
* The Submit Button
*/
#login input[type=submit] {
background-color:#e74c3c;
border-radius:0px;
border:none;
border-bottom:4px solid #c0392b;
}
#login input[type=submit]:active {}
/*
* The Back to blog and Forgot Password link
*/
#nav a,
#backtoblog a {
color:#000 !important;
}
<?php
// Adding the function to the login page
add_action('login_head', 'custom_login');
// Our custom function that includes the custom stylesheet
function custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo( 'stylesheet_directory' ) . '/custom-login.css" />';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment