Add class to every other posts using get_posts
A simple solution would be to add an alternating class to every other post in the list. In particular, (in your style.css) style the list elements <li> in one particular way, and then over-ride that style for list elements of a particular class <li class=”my-alternate-class”>. The class my-alternate-cass will applied to every other list element: … Read more