Hi, this is possible using CSS rules linked to categories.
If you look at the source code of a category page you will see a special CSS class assigned to the body (eg. post-in-category-xxxxx).
You just need to create a class touching the background element for this body class (eg. .post-in-category-xxxxx {background-color:#000;}).
Thanks for the reply,
But my problem is that I’m not very familiar with css or coding. Can you help me?
Right now I have for categories. Business, food, entertainment and inspiration.
What codes should I put in the custom css that I’m seeing when I customize it.
Here are the color combination
Business- blue
Food- Green
Entertainment- purple
Inspiration- Yellow
Any help is appreciated, thank you very much 😀
Without url towards the site difficult to help you, if we remain the correspondences of category of WordPress:
Business -> business
This gives the following rule:
body.post-in-category-business {background-color: blue;}
Here the color is generic, you can change the word by a hexadecimal value that you will find on a site like coolors.co.
You can add custom CSS rules in:
Appearance -> Customizer -> Additional CSS
Hello,
Kindly try to add the below code to the Appearance > Customize > Custom CSS section to change it –
body.category-bicycle {
background-color: #000;
}
Replace the ‘bicycle’ in the code with your actual category slug for each category if you want to have different colors for different categories.
Thanks!
I tried it, but nothing changed. I also tried with the post-in-category code it also didn’t work.
It’s in the post slider btw, the background color I’m talking about. How can I change it if it’s there?
Hi can you help me? Thanks 😀