Skip to content

Instantly share code, notes, and snippets.

@Brandonsmith23
Created September 12, 2018 17:18
Show Gist options
  • Save Brandonsmith23/2afc0ce8886507c532169755db329a2f to your computer and use it in GitHub Desktop.
Save Brandonsmith23/2afc0ce8886507c532169755db329a2f to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Login Style
Version: 0.1-alpha
Description: Styling for the login screen
Author: Your Name
Author URI: Your URL
Plugin URI: Your URL
Text Domain: Your Text Domain
Domain Path: /languages
*/
function ws_login_logo() { ?>
<style type="text/css">
body.login {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/img/background-image.jpg);
background-size: cover;
}
body.login div#login a {
color: #ffffff;
}
body.login div#login h1 a {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/img/logo.jpg);
background-size: cover;
width: 35%;
}
.login form {
background: rgba(0,0,0,0.7);
}
#loginform label{
color: #ffffff;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'ws_login_logo' );
function ws_login_logo_url() {
return home_url();
}
add_filter( 'login_headerurl', 'ws_login_logo_url' );
function ws_login_logo_url_title() {
return 'Custom Login';
}
add_filter( 'login_headertitle', 'ws_login_logo_url_title' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment