WP_Query
will track which post is current. For example:
$p = new WP_Query(array('post_type'=>'post','posts_per_page'=> 10));
if ($p->have_posts()) {
while ($p->have_posts()) {
$p->the_post();
echo $p->current_post.'<br>';
}
}
You could use that to selectively format your posts. For example
$p = new WP_Query(array('post_type'=>'post','posts_per_page'=> -1));
if ($p->have_posts()) {
while ($p->have_posts()) {
$p->the_post();
switch ($p->current_post) {
case 0:
case 3:
case 4:
echo '<div class="layout1">....</div>';
break;
case 1:
echo '<div class="layout2">....</div>';
break;
case 2:
echo '<div class="layout3">....</div>';
break;
}
}
}
I can’t tell if you have a pattern that you might be able to map mathematically or if you are going to have to manually construct the whole switch.