[Support request] Add Class to Featured Post, Two or More Featured Posts on the Blog

Home Forums Support [Support request] Add Class to Featured Post, Two or More Featured Posts on the Blog

Home Forums Support Add Class to Featured Post, Two or More Featured Posts on the Blog

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #1526379
    David
    Staff
    Customer Support

    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;
    } );
    #1526617
    Vlidi

    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!

    #1526666
    David
    Staff
    Customer Support

    You’re welcome!
    Yes – i agree the multiple categories would be a nice feature…. if we find a solution we’ll let you know!

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.