Skip to content

Instantly share code, notes, and snippets.

@eclarrrk
Last active March 14, 2019 18:35
Show Gist options
  • Save eclarrrk/9072cc11fad4588ef95e2c2f03fcc102 to your computer and use it in GitHub Desktop.
Save eclarrrk/9072cc11fad4588ef95e2c2f03fcc102 to your computer and use it in GitHub Desktop.
Style the WordPress login page
<?php
// Add styles to the login page
function login_css() { ?>
<style type="text/css">
/* Change the WP logo to your own */
#login h1 a, .login h1 a {
background-image: url('<?php echo get_stylesheet_directory_uri(); ?>/path/to/logo.png');
height: 150px;
width: 150px;
background-size: 150px 150px;
background-repeat: no-repeat;
}
</style>
<?php }
// Change the URL of the link wrapping the logo
add_action( 'login_enqueue_scripts', 'login_css' );
function my_login_logo_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_login_logo_url' );
// Change the title of the link wrapping the logo
function my_login_logo_url_title() {
return 'Integrous Fences and Decks';
}
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