Site logo

Archived topic

Styling the wordpress login

4 replies · Started by Carole on August 23, 2020

Viewing posts 1–5 of 5

Hello,

I am trying to follow some instructions given to me to style the Wordpress login but it does not work:

1. I added this in the functions.php child theme -
function my_custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('stylesheet_directory') . '/login/custom-login-styles.css" />';
}
add_action('login_head', 'my_custom_login');

2. Created a LOGIN folder in the Generate Press Child theme folder

3. Create a custom-login-styles-css sheet in the login folder

Unfortunately, any CSS changes I make in the CSS files don't change anything.

What am I doing wrong?
Carole

Hi there,

try the login_enqueue_scripts hook instead of the login_head

Thank you!
I tried the following CSS - body.login {
background-color: #313b3d;
}
but no luck:(
Carole

I followed the instructions by changing

function my_custom_login() {
echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . get_bloginfo(‘stylesheet_directory’) . ‘/login/custom-login-styles.css” />’;
}
add_action(‘login_head’, ‘my_custom_login’);

to

function my_custom_login() {
echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . get_bloginfo(‘stylesheet_directory’) . ‘/login/custom-login-styles.css” />’;
}
add_action(‘login_enqueue_scripts’, ‘my_custom_login’);

Is this correct?

Thanks

This archived topic is closed to new replies.