Last active
December 17, 2015 19:19
-
-
Save Dianakc/21b737efc784e6a37290 to your computer and use it in GitHub Desktop.
Adiciona uma classe especial para o primeiro post em um loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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