Skip to content

Instantly share code, notes, and snippets.

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