I have this code in my home.php, the very first post class does not get the class while the others do. Same thing when i move this code to functions.php. I get php errors when i remove the hook around it and just add the filter.
add_action('pre_get_posts', 'theme_add_post_class');
function theme_add_post_class() {
/** Add custom post class */
add_filter( 'post_class', function( $classes ) {
$classes[] = 'span4';
return $classes;
} );
}
}