Inside a loop, how to change CSS class based on category name?
What you need is post_class, a function that will add several classes linked to the post. You would use it in the main div around your loop and you can also add your own classes. In your case: <div ?><?php post_class (“col-xl-3 col-lg-4 col-md-4 col-sm-6 n-container-sm”) ?> > This will add the category name as … Read more