Correct a few mistakes in vtxyzzy’s post
<?php $c = 0; $style=''; if (have_posts()) : while (have_posts()) : the_post(); $c++; if( $c == 1 ) { $style='first'; } elseif ( $c == $wp_query->post_count ) { $style='last'; } ?>
<div <?php post_class($style);?> id="post-<?php the_ID();?>">
Thanks