Cannot changing login button color, have tried theme, plugins… is it GoDaddy managed?

wordpress.stackexchange https://wordpress.stackexchange.com/questions/377447

  •  21-04-2021
  •  | 
  •  

Question

I have added this code into my theme Customization and also Simple Custom CSS plugin

.wp-core-ui #login .button-primary {
  background: #7e0001 !important; 
  background-image: none !important;
  border-color: #7e0001; 
}

For the life of me I cannot that code override the 'default blue' of the WordPress login button. The only plugin that works is "Login Press" which seems to use the exact same CSS as me, but somehow WordPress pays attention to it and not my theme CSS. I don't need to style the whole thing I just want to colorize the damn button.

Is it me? Is it GoDaddy WordPress Managed hosting?

Était-ce utile?

La solution

The login page doesn't load your theme's stylesheet.

If you want to include extra CSS on your login page then you should hook login_enqueue_scripts and write out an extra <style> tag there, or include another CSS file (or even your theme's full CSS file if you want to).

You could also use login_head, and there's an example of including another CSS file in the login_head documentation, but it sounds like login_enqueue_scripts is more correct.

Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange
scroll top