I have a Wordpress loop as follows:
<?php $loop = new WP_Query( array( 'post_type' => 'portfolio' ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="four columns">
<?php the_content(); //along with other stuff in looped div ?>
</div>
<?php endwhile ?>
How can I add an 'alpha' class to every (4n-3)th div (div.four.columns) and an 'omega' class to every (4n)th item using php?
Thanks (a lot!), Jamie
counter % 3 == 0then it is "every 3rd loop". Likewise,counter % 4 == 0for "every 4th loop". Do extra math as required.