Skip to content

Instantly share code, notes, and snippets.

@jimboobrien
Forked from wpscholar/customize-wp-login.php
Created September 20, 2017 23:29
Show Gist options
  • Save jimboobrien/fd3049a13f9724ffe62f2a51ad4d019e to your computer and use it in GitHub Desktop.
Save jimboobrien/fd3049a13f9724ffe62f2a51ad4d019e to your computer and use it in GitHub Desktop.
Customize the login form in WordPress
<?php
/**
* Customize the login form in WordPress
* @author Micah Wood <micah@wpscholar.com>
*/
/**
* Change the href for the logo link on login page to point to the main site
*/
add_filter( 'login_headerurl', 'change_login_headerurl' );
function change_login_headerurl(){ return home_url(); }
/**
* Change the title attribute for the logo link on the login page to be the tagline
*/
add_filter('login_headertitle', 'change_login_headertitle');
function change_login_headertitle(){ return get_bloginfo('description'); }
/**
* Add our custom css and background image to the header of the login page
* Note: You will need to adjust the URL to point to a valid image file
*/
add_action('login_head', 'change_login_head');
function change_login_head(){
echo '<style type="text/css">#login h1 a { background: url("../images/logo.png") no-repeat; }</style>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment