Controlling how the loop repeats elements
-
I set up a small 3-post loop on my static page to show the excerpts of featured posts. It’s working alright, but I want to separate them like so:
post | post | post
with a line between them. However, since the loop repeats all elements, it ends up like this:
post | post | post |
Is there a way to stop the last element from appearing like that? On a similar note, I’d also like to know how to alternate divs for each post in the loop, like this:
begin loop <div class="1">Post</div> <div class="2">Post</div> <div class="1">Post</div> <div class="2">Post</div> end loop
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Controlling how the loop repeats elements’ is closed to new replies.