Skip to content

Instantly share code, notes, and snippets.

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 MariaJackson1/d5fdf5efd8dbf539ff5312bb069c8519 to your computer and use it in GitHub Desktop.
Save MariaJackson1/d5fdf5efd8dbf539ff5312bb069c8519 to your computer and use it in GitHub Desktop.
WilBrown.com custom login page, two column, responsive
function wb_login_head(){
?>
<style>
#login{
width:50%;
float:left;
}
#wbd-login-left{
width:50%;
float: right;
height:100%;
background-color:black;
background-image: url("<?php echo get_stylesheet_directory_uri();?>/assets/img/wil/wil-brown-black-arms-folded-800.webp");
background-size:contain;
background-repeat:no-repeat;
}
#login{
padding-top:4%;
}
#login h1 a {
background-image:url('<?php echo get_stylesheet_directory_uri();?>/assets/img/logo/wil-brown-with-tagline-175.webp') !important;
height:175px !important;
width: auto !important;
background-size: auto auto !important;
}
#login p.submit{
text-align:center;
}
#login .button-primary{
background-color: <?php echo WB_BRAND_PRIMARY_ORANGE?>;
border: 2px solid <?php echo WB_BRAND_PRIMARY_ORANGE?>;
text-transform: uppercase;
float:none;
}
#login .button-primary:hover {
color: <?php echo WB_BRAND_PRIMARY_ORANGE?>;
background-color: white;
}
#login .forgetmenot{
float:none;
}
#loginform{
border-color: <?php echo WB_BRAND_PRIMARY_ORANGE?>;
margin: 4%;
}
#loginform input[type=text]:focus,
#loginform input[type=checkbox]:focus,
#loginform input[type=password]:focus{
border-color: <?php echo WB_BRAND_PRIMARY_ORANGE?>;
box-shadow:none;
}
#loginform input[type=checkbox]:checked::before {
content: url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23<?php echo '00af19';?>%27%2F%3E%3C%2Fsvg%3E);
}
#login .privacy-policy-page-link{
margin:2rem 0 0 0;
}
#login .button.wp-hide-pw .dashicons{
color: <?php echo WB_BRAND_PRIMARY_ORANGE?>;
}
@media only screen and (max-width: 768px) {
#wbd-login-left{
display:none;
}
#login{
width:100%;
float:none;
}
#login h1 a {
background-image: url('<?php echo get_stylesheet_directory_uri();?>/assets/img/logo/wil-brown-with-tagline-75.webp') !important;
height: 75px !important;
}
}
</style>
<div id="wbd-login-left">
</div>
<?php
}
add_action( 'login_head', 'wb_login_head' );
/**
* Disable language selector on login screen
*
* @return false
*/
function wb_disable_login_language_selector(){
return false;
}
add_filter( 'login_display_language_dropdown', 'wb_disable_login_language_selector' );
/**
* Change the URL of the picture on the login screen
*/
function wb_wp_login_url() {
return home_url();
}
add_filter('login_headerurl', 'wb_wp_login_url');
/**
* Change the default WordPress password protection message
*
* @param $content
* @return string|string[]
*/
function wb_password_protected_message($content) {
global $post;
if (!empty($post->post_password)) {
$content = str_replace(
'This content is password protected. To view it please enter your password below:',
'<i class="fad fa-user-secret"></i> To view the content on this page, please enter the password below:',
$content
);
}
return $content;
}
add_filter('the_content', 'wb_password_protected_message');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment