Skip to content

Instantly share code, notes, and snippets.

@neoighodaro
Last active Aug 29, 2015
Embed
What would you like to do?
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