Site logo

Archived topic

Additional class for inside-article div (depending on post category)

3 replies · Started by Dominik on September 16, 2018

Viewing posts 1–4 of 4

Hello there!

At first let me explain what I try to achieve. On my posts list (standard blog page) I want to add additional CSS code for the inside-article div, but only for posts of one specific category, named '123'. My goal is to add simple ribbon in the top left corners with CSS (I already know how to do it). I think the easiest way is to add additional CSS class, only for posts labeled with my '123' category, but I don't know how. Or maybe you have much better solution?

Please help me guys! :)

Hi there,

the post articles carry a category-slug class so you can target them like so:

.post.category-slug .inside-article {
	Styles here
}

Oh for God's sake, where were I looking at?!

Thank you! <3

haha - i have used them a lot particularly in Woocommerce :) Glad to be of help.

This archived topic is closed to new replies.