Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change post class if first post
<?php
if ($wp_query->current_post == 0 && !is_paged()) :
$first = ( $wp_query->current_post == 0 && !is_paged() ) ? 'firstpost' : ''; post_class($first);
else :
post_class();
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment