Created
May 28, 2017 17:12
-
-
Save anonymous/9e40eee19d5bcfa164667644b0799da1 to your computer and use it in GitHub Desktop.
Custom WordPress login page
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
// Custom login page | |
function my_login_logo() { ?> | |
<style type="text/css"> | |
#login h1 a, .login h1 a { | |
background-image: url(/images/logo.png); | |
padding-bottom: 45px; | |
background-size: 285px; | |
height: 100%; | |
width: 100%; | |
} | |
body.login { | |
background: #2196f3; /* fallback for old browsers */ | |
background: -webkit-linear-gradient(to left, #2196f3 , #f44336); /* Chrome 10-25, Safari 5.1-6 */ | |
background: linear-gradient(to left, #2196f3 , #f44336); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ | |
} | |
#login .button.button-large { | |
height: 40px; | |
padding: 0 12px 3px; | |
background: #1369a9; | |
width: 100%; | |
margin-top: 20px; | |
-webkit-transition: 0.3s ease; | |
transition: 0.3s ease; | |
} | |
.login form { | |
border-top: 5px solid #d81d28; | |
} | |
.login #backtoblog { | |
display: none; | |
} | |
.login form .forgetmenot { | |
background: #f2f2f2; | |
width: 100%; | |
padding: 10px 40px; | |
box-sizing: border-box; | |
color: #666666; | |
font-size: 12px; | |
text-align: center; | |
} | |
.login #nav { | |
margin: 40px 0 0; | |
font-size: 24px; | |
font-weight: 300; | |
text-align: center; | |
} | |
.login #nav a { | |
color: #ececed !important; | |
font-size: 24px; | |
} | |
</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_logo_url_title() { | |
return 'My Custom Login Page'; | |
} | |
add_filter( 'login_headertitle', 'my_login_logo_url_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment