Skip to content

Instantly share code, notes, and snippets.

@neoighodaro
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neoighodaro/38581b71489309855e6d to your computer and use it in GitHub Desktop.
Save neoighodaro/38581b71489309855e6d to your computer and use it in GitHub Desktop.
WordPress Custom Login functions file
if ( ! function_exists( 'ck_custom_login_css' ) )
{
/**
* Load the custom login page CSS.
*
* @return void.
*/
function ck_custom_login_css()
{
echo '<link rel="stylesheet" type="text/css" href="'.get_stylesheet_directory_uri().'/login.css" />';
}
}
add_action('login_head', 'ck_custom_login_css');
if ( ! function_exists('ck_rememberme_checked'))
{
/**
* Checks the "remember me" by default.
*
* @return void
*/
function ck_rememberme_checked()
{
echo "<script>document.getElementById('rememberme').checked = true;</script>";
}
}
add_action('login_footer', 'ck_rememberme_checked');
// Hides the login error message
add_filter( 'login_errors', create_function( '$a', "return null;" ) );
// Changes login logo URL to your homepage
add_filter( 'login_headerurl', create_function( '$a', "return '".get_bloginfo('url')."';" ) );
// Change logo link title to your site name
add_filter( 'login_headertitle', create_function( '$a', "return '".get_bloginfo('name')."';" ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment