960gs different classes on teasers posts

Even better way is to check the current post position in query:

global $wp_query;

while (have_posts()) : the_post();
    $my_class="";
    if ( $wp_query->current_post == 0 ) $my_class=" first";
    if ( $wp_query->current_post == $wp_query->post_count - 1 ) $my_class=" last";

    ?><div class="post<?php echo $my_class; ?>"><?php

    ...

    if ( $wp_query->current_post == $wp_query->post_count - 1 ) echo 'THE CONTENT UNDER THE FIRST POST';

endwhile; // End the loop

Leave a Comment