Custom Login Page
Last updated 2 years ago
PHP
/**
* Custom CSS for Login Page.
*
* @access public
* @return void
*/
function hlabs_custom_login() {
wp_register_style( 'custom-login', get_template_directory_uri() . '/assets/css/custom-login.css', true, 'all' );
wp_enqueue_style( 'custom-login' );
remove_filter( 'wp_admin_css', 'wp_admin_css' );
}
add_action( 'login_head', 'hlabs_custom_login' );
Change URL for Login Logo:
PHP
/**
* Change URL for Login Logo.
*
* @access public
* @return Home URL.
*/
function hlabs_wp_login_url() {
return home_url();
}
add_filter( 'login_headerurl', 'hlabs_wp_login_url' );
Hide Powered by WordPress Title:
PHP
/**
* Hides "Powered by WordPress" Title on Login Logo.
*
* @access public
* @return Site Title.
*/
function hlabs_wp_login_title() {
return get_option( 'blogname' );
}
add_filter( 'login_headertitle', 'hlabs_wp_login_title' );
All code snippets are licensed GPLv2 or later unless otherwise stated.