Chris Walton

Fancy a Custom WordPress Login Page? Heres How

Custom login pages can give website owners the opportunity to make brand their website for employees especially for larger multi-user sites like news outlets.

Sure you can install a module like the Custom Login Page Customizer but if you have a little CSS know-how why not do it yourself?

This is how I have been doing it, first open your functions.php file and add the following lines of code;

function custom_login_css() {
wp_enqueue_style( 'theme_login_css', get_template_directory_uri() . '/css/login.css', false );

This simply calls a custom CSS file to the login page allowing you to style it.

Next we need to add a pair of functions which will update the logo URL and alt text to use your sites URL and Name.

function custom_login_url() { return home_url(); }
function custom_login_title() { return get_option('blogname'); }

Finally set a call so they are only loaded on the login page.

add_action( 'login_enqueue_scripts', 'theme_login_css', 10 );
add_filter('login_headerurl', 'theme_login_url');
add_filter('login_headertitle', 'theme_login_title');

Now all you need to do is create your custom login.css file and drop it into the location you set in step one, I will leave this bit up to you.