Home > Dev > WordPress Customization > Customizing the Login Page

Customizing the Login Page

This code will customize the WordPress login page.

// Add this to your theme's functions.php file

function custom_login_styles() {
    echo '
    <style type="text/css">
        body.login {
            background-color: #f1f1f1;
        }
        #login h1 a {
            background-image: url(' . get_stylesheet_directory_uri() . '/images/custom-logo.png);
            background-size: contain;
            width: 100%;
            height: 80px;
        }
        .login form {
            background: #fff;
            border: 1px solid #ccc;
        }
    </style>';
}
add_action('login_enqueue_scripts', 'custom_login_styles');

function custom_login_url() {
    return home_url();
}
add_filter('login_headerurl', 'custom_login_url');

function custom_login_title() {
    return 'Your Site Name';
}
add_filter('login_headertext', 'custom_login_title');
Back