I need to slect every third element and from there on every fourth in a php loop for wordpress custom posts. So i have to select 3,7,11,15....
I actually select every third element but thats not the thing i need for the function i need:
<?php $counter = 1; ?>
<?php if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php if($counter%3 == 0 : ?>
<p>Do this on the third and from there on on every fourth element</p>
<?php else : ?>
<p>Do something else.</p>
<?php endif; ?>
<?php $counter++; ?>
<?php endwhile; ?>
<?php else: ?>
<?php endif; ?>