How to style the first / last / latest / newest post in a WordPress site different?
The default advice usually is to use a counter variable and a conditional statement to check for the first post in the loop; that approach obviously works fine, however requires a few lines of extra code before and in the loop.
A more condensed approach is to use
$wp_query->current_post which returns the current post number in the loop, starting with 0 (zero) for the first post.
This can be combined with a check, if the page is really the first page, and not one of the paginated pages, using
If the goal is just to apply different css styles to the first post, it is best to add a unique css class to the post_class() which is used in most recent themes; like so:
post_class($extra); to add the extra class to post_class.
All combined might look like (based on the code of content.php in Twenty Eleven):
<article id="post-<?php the_ID(); ?>" <?php $extra = ( $wp_query->current_post == 0 && !is_paged() ) ? 'specialclass' : ''; post_class($extra); ?>>
If the goal is to have a totally different output for the first post, then a conditional structure is needed (within the loop, wrapping the post output):
<?php if( $wp_query->current_post == 0 && !is_paged() ) : ?> /*the output of the first post*? <?php else : ?> /*the output of all other posts*/ <?php endif; ?>