Skip to content

Instantly share code, notes, and snippets.

@mattradford
Last active April 14, 2016 11:35
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mattradford/e9a9cfda01e1b15191eb to your computer and use it in GitHub Desktop.
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