Ask any question about WordPress here... and get an instant response.
Post this Question & Answer:
How can I customize the WordPress login page styling using functions.php? Pending Review
Asked on Mar 26, 2026
Answer
To customize the WordPress login page styling, you can add custom CSS through the `functions.php` file of your theme. This involves using the `login_enqueue_scripts` action hook to enqueue your styles.
<!-- BEGIN COPY / PASTE -->
function my_custom_login_styles() {
wp_enqueue_style('custom-login', get_stylesheet_directory_uri() . '/custom-login.css');
}
add_action('login_enqueue_scripts', 'my_custom_login_styles');
<!-- END COPY / PASTE -->Additional Comment:
- Create a file named "custom-login.css" in your theme directory to add your custom CSS rules.
- Ensure the path in `get_stylesheet_directory_uri()` matches the location of your CSS file.
- Use CSS selectors like `#login` and `.login h1 a` to target specific elements on the login page.
- Remember that changes in `functions.php` will be lost if the theme is updated unless using a child theme.
Recommended Links:
