• Resolved bguk50

    (@bguk50)


    Made some great progress. Have four filters in an can stylise each one differently. In my first filter I have posts which are all sorted into category A or B. I would like the filter post list to display each post with a different background colour for post.container post.item depending on the category of the post retrieved. So in my filter, the initial five posts displayed might have 3 x A (blue) and 2 x B (Red) as per the order of sorting by date descending. I can presently style all post.items in one filter the same way but not differentiate according to the category of post fetched.

    Really appreciate any ideas you might have. I’ve look at adding something to functions.php and css but no luck.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author YMC

    (@wssoffice21)

    Hi!
    You can use a hook to find the desired post in the grid. Try using this hook add_action( 'ymc_after_custom_layout_545_1', 'ymc_after_custom_layout', 10, 2 ); to find the desired post and then you can assign a class to it to style the container. Or, you can use nth-child() styles to set the desired background for the post card.

    See doc. – https://github.com/YMC-22/smart-filter

Viewing 1 replies (of 1 total)

The topic ‘Different container colours per post category’ is closed to new replies.