Hello, I’m trying to add a class to a blog post based on whether the post is an even or odd number. It’s almost working–the class is being echoed–but I think I’ve made a mistake in editing the loop because now only two posts will show up on blog home page. Does anyone have any ideas?
Here’s the code I’m using:
Like I said, everything is working except for the fact that I’m only given two posts, even though I have published six.
Thanks for your help!
- The topic ‘Add a class based on even or odd post’ is closed to new replies.