Skip to content

Instantly share code, notes, and snippets.

@hmcclungiii
Created January 19, 2016 20:02
Show Gist options
  • Save hmcclungiii/5c335b7a84510e57ae17 to your computer and use it in GitHub Desktop.
Save hmcclungiii/5c335b7a84510e57ae17 to your computer and use it in GitHub Desktop.
Adds a custom stylesheet to your WordPress Login Page.
<?php
/* You can remove the above opening php tag
when pasting this code inside your
functions.php file.
*/
/* The following code adds your custom stylesheet
to the wordpress login screen, allowing you to
customize the background, colors and fonts of the
page to match your custom theme.
Your stylesheet must be saved in the /library/css
folder of your theme root. For example, if your theme
is twentythirteen, the login.css file would be at
www.mysite.com/wp-content/themes/twentythirteen/library/css/login.css
The following code snippet must added to your functions.php file.
*/
function login_enqueue_my_css() {
echo('<style type="text/css">');
include('/library/css/login.css');
echo('</style>');
}
add_action('login_enqueue_scripts','login_enqueue_my_css');
/* If this is the end of the functions.php
file, you must delete the closing tag below
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment