Site logo

[Support request] Archive Category Pages Displaying Entire Post on Video Post Type

Home Forums Support [Support request] Archive Category Pages Displaying Entire Post on Video Post Type

Home Forums Support Archive Category Pages Displaying Entire Post on Video Post Type

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2549362
    Morgan

    This one has been bugging me for a while…

    For some reason, my category/archive pages are working fine with any post type=standard with a small pic, headline and excerpt. But any post with type = video, is trying to display the ENTIRE ARTICLE instead of the excerpt like the standard post types do.

    Link Here:
    https://www.thesmokies.com/category/sevierville/

    For visual reference, I want all posts to look like this:
    https://media.thesmokies.com/2023/02/Standarad.png

    And NOT this:
    https://media.thesmokies.com/2023/02/Video.png

    #2549858
    David
    Staff
    Customer Support

    Hi there,

    so a video post format, doesn’t generate an excerpt by default, as it relies on displaying the Content with its HTML intact so as the Video embed can be displayed.

    You can tell GP to load an excerpt using this PHP Snippet:

    add_filter( 'generate_show_excerpt', function( $show ) {
        if ( 'video' === get_post_format() ) {
            return true;
        }
    
        return $show;
    } );

    Reference: https://docs.generatepress.com/article/excerpt-issues/#full-post-content-displaying-while-using-excerpt

    But this will treat it like any other post ie. a featured image and excerpt. Not a video thats within the content.

    Does that work for you ? Or must the archive show the video embed before the excerpt ? ( as thats a lot more tricky )

    #2554576
    Morgan

    Worked PERFECTLY thank you again David

    #2555160
    David
    Staff
    Customer Support

    You’re welcome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.