Skip to content

Instantly share code, notes, and snippets.

@Dianakc
Last active December 17, 2015 19:19
Show Gist options
  • Save Dianakc/21b737efc784e6a37290 to your computer and use it in GitHub Desktop.
Save Dianakc/21b737efc784e6a37290 to your computer and use it in GitHub Desktop.
Adiciona uma classe especial para o primeiro post em um loop
<?php
function mark_first_post( $classes )
{
remove_filter( current_filter(), __FUNCTION__ );
$classes[] = 'first-post';
return $classes;
}
add_filter( 'post_class', 'mark_first_post' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment