[Support request] Additional class for inside-article div (depending on post category)

Home Forums Support [Support request] Additional class for inside-article div (depending on post category)

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #678425
    Dominik

    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! ๐Ÿ™‚

    #678432
    David
    Staff
    Customer Support

    Hi there,

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

    .post.category-slug .inside-article {
    	Styles here
    }
    #678436
    Dominik

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

    Thank you! <3

    #678439
    David
    Staff
    Customer Support

    haha – i have used them a lot particularly in Woocommerce ๐Ÿ™‚ Glad to be of help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.