Archived topic
Add Class to Featured Post, Two or More Featured Posts on the Blog
17 replies · Started by Vlidi on November 7, 2020
Lets try including the first post in Tom's filter like so:
add_filter( 'generate_page_header_default_size', function( $size ) {
global $wp_query;
$current_post = $wp_query->current_post + 1;
if ( $current_post % 5 == 0 || $current_post == 1 ) {
return 'medium_large';
}
return $size;
} );
Oh yes sir David, it works, thank you very much! :-)
Very grateful for your help.
If you ever figure out how to filter this by categories/taxonomies so that the latest posts from each gets displayed as "Featured" (instead of the "numerical" and actually random selection as it is now), I guess this could become a kind of a feature quite a few people may consider for their Blog layout.
Big thanks to you and Tom once again, the support here is amazing!
You're welcome!
Yes - i agree the multiple categories would be a nice feature.... if we find a solution we'll let you know!