When we start to customize admin area first thing that comes to modify WordPress default login/registration page. For a client oriented site, it is required to customize Login page effectively.
The best thing about WordPress is that each part of backend can be easily customized using simple PHP functions. In this article, we are going to learn about how to customize WordPress login/registration page with your own logo and add your background image .
To achieve this, first add the below code in your functions.php file.
function smallenvelop_login_css() {
wp_enqueue_style( 'smallenvelop_login_css', get_template_directory_uri() . '/css/login.css' );
}
add_action('login_head', 'smallenvelop_login_css');
In this function we include a custom css file ‘login.css‘ that we will make in our theme to overwrite the WordPress default admin CSS.
Now write this css code into our new custom css file ‘login.css‘ for change logo and background respectively in our site.
.login h1 a {
background-image: url("../images/logo.png") !important;
}
body.login {
background-image: url("../images/bg-smallenvelop.jpg") !important;
background-size:100%;
}
Note that the name and the path of images should be correct.
You can add a custom message on your WordPress login page and also customize your WordPress login page with WordPress customizer.
Hello Dear, Nice blog . I’m very happy to read your articles .