Seems like a trivial problem but I can't get it to work. I need to add class="last"
to every third post.
Here is my code:
<?php
$count = 0;
$my_query = new WP_Query('cat=-18,-7&showposts=9');
while ($my_query->have_posts()) : $my_query->the_post();
?>
<article class="<?php if ($count % 3 == 0) { echo "last "; }" ?>> </article>
<?php
$count++;
endwhile;
?>