Alternate loop output every three posts (within the same original loop)
-
I have a (relatively) tricky situation where my code requires changing the loop output every three posts, and within those three posts there are divs around two of the posts.
The code below displays 6 posts and I would want to loop though a total of 24 posts, repeating this four times.
Can anyone help? Thanks!
FIRST THREE
<div class="layer"> <div class="large left"> <div class="item"> <?php the_title(); ?> <?php the_content(); ?> </div><!--item--> </div> <div class="small left"> <div class="item"> <?php the_title(); ?> <?php the_content(); ?> </div><!--item--> <div class="item"> <?php the_title(); ?> <?php the_content(); ?> </div><!--item--> </div> </div><!--layer-->
SECOND THREE
<div class="layer"> <div class="small left"> <div class="item"> <?php the_title(); ?> <?php the_content(); ?> </div><!--item--> <div class="item"> <?php the_title(); ?> <?php the_content(); ?> </div><!--item--> </div> <div class="large right"> <div class="item"> <?php the_title(); ?> <?php the_content(); ?> </div><!--item--> </div> </div><!--layer-->
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Alternate loop output every three posts (within the same original loop)’ is closed to new replies.