[Resolved] Blog archives showing all content instead of excerpt using Video post format

Home Forums Support [Resolved] Blog archives showing all content instead of excerpt using Video post format

Home Forums Support Blog archives showing all content instead of excerpt using Video post format

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1014260
    Pascal

    Hi there, I’m trying to set my blog archive pages in order to show a YouTube video and an excerpt of the post content. I’ve selected Video post format but my blog archives are showing all content beneath the video instead of only the post excerpt. Do you have any solution for this?
    Thanks in advance 4 your help!
    Pascal

    HERE A SCREENSHOT » https://imgur.com/a/7PuR9iX

    #1014268
    David
    Staff
    Customer Support

    Hi there,

    try adding this PHP snippet:

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

    https://docs.generatepress.com/article/adding-php/

    #1014280
    Pascal

    Hi David, thanks 4 the snippet! It works great but it hides also the featured video. Is there a way to keep the featured video and make it appear instead of the featured image in blog archives?
    Thanks again for your help!
    Pascal

    #1014288
    David
    Staff
    Customer Support

    Oops – i didn’t look close enough to see you had the video in post content.
    So excerpts are stripped of HTML by default in WordPress.
    Two choices:

    1. Use the Read More tag in your post:
    https://docs.generatepress.com/article/using-the-more-tag/

    2. The Advanced Excerpts plugin in the WordPress repository

    #1014336
    Pascal

    Thanks David! The “Read more” solution works perfectly! 🙂

    #1014635
    David
    Staff
    Customer Support

    Glad to be of help

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