• On a site like adformatie.nl some posts have the category ‘premium’ and this is visualized by styling the category name with a colour and a symbol, a star in this case. I’d like to do something like that on my website. Any suggestions how to achieve this?

    • This topic was modified 2 years, 1 month ago by timdevogel.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Ideally one of the post’s HTML elements would have a class attribute that identifies which posts should get the visualization over its featured image. Then you could use that as a CSS selector to add ::before pseudo-content that actualizes the visualization.

    It doesn’t look like there is any such distinction in your site’s HTML. You’d need to modify the template code responsible for output to add additional class attributes based on assigned category. Then it’s a matter of applying the right CSS.

    Thread Starter timdevogel

    (@timdevogel)

    I’m afraid that’s a bit out of my scope. There’s no plug in to take care of this?

    Moderator bcworkz

    (@bcworkz)

    The only plugins I’ve found after a quick search all relate to WooCommerce products. It’s the same concept that you’re after, except specifically for WooCommerce products. There’s a chance one of the plugins could be customized to apply to more than products, but you’re likely back into out of scope territory again.

    It looks like your site already has some kind of category visualization over featured images. Perhaps not the premium category, but some kind of category. You may be better off leveraging that existing mechanism to better fit your need. Try asking in the dedicated support channel of whichever module is responsible for this feature. Maybe there’s a way to get what you want that way.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add some styling to a category excerpt on the home page’ is closed to new replies.