Last active
March 14, 2019 18:35
-
-
Save eclarrrk/9072cc11fad4588ef95e2c2f03fcc102 to your computer and use it in GitHub Desktop.
Style the 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
<?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