Display Posts adds a class of .listing-item to each post in the listing. You can customize the classes using the display_posts_shortcode_post_class filter. If you’re using Display Posts for a table of contents in a sidebar, it’s helpful to style the current post differently than the others. The code below will add a class of .current-list-item […]
Filter: display_posts_shortcode_post_class
Add or modify the CSS classes on the individual posts in the listing.
Add category classes
I’m using the short code but there are some categories I would like to show in one color and then other categories should show in a different color. LesTexas60 You can use the display_posts_shortcode_post_class filter to customize the classes added to each post. Here’s how to add a class for each category attached to a post: