I want to break the loop into sections of posts so I can put content in between that doesn't repeat. Is it possible to end the loop and restart?
My code works for my layout works if there are 10 posts on a page. When I have fewer it breaks because the closing div for .grid is tied in with the 10th post showing.
This shows my layout: 1st post, 2-5 in a grid, a non-post div separating, repeat of post then posts in a grid.
<?php if ( have_posts() ) :
$count = 0;
while ( have_posts() ) : the_post();
$count++;
if ($count == 1) : ?>
<article class="large"></article>
<?php elseif ($count == 2) : ?>
<div class="grid">
<article></article>
<?php elseif ($count == 3) : ?>
<article></article>
<?php elseif ($count == 4) : ?>
<article></article>
<?php elseif ($count == 5) : ?>
<article></article>
</div> <!-- .grid -->
<div id="edit">
</div> <!-- #edit -->
<?php elseif ($count == 6) : ?>
<article class="large"></article>
<?php elseif ($count == 7) : ?>
<div class="grid">
<article></article>
<?php elseif ($count == 8) : ?>
<article></article>
<?php elseif ($count == 9) : ?>
<article></article>
<?php elseif ($count == 10) : ?>
<article></article>
</div> <!-- .grid -->
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>