• Resolved LesTexas60

    (@lestexas60)


    I love this plugin. I use this to show products in a list. I also use it to show customer referrals. If I use show content =True I can attach a video and it will play in the display portion of the window. Sometimes there is just to much content so I have to set it to show an excerpt. When I don’t show full content, the video does not show on the Display area, you have to click on the post and go to the page. Is there any way to show the Image/video and still only show an excerpt? This would be a great setting so people can play the video from the first display screen.
    Thanks for a great plugin

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Yes you can, but it will require some code customization by you.

    First, you’ll need to store the video in metadata rather than in the post content itself. That way it can be accessed separate from the full post content. You can use a metabox plugin like Advanced Custom Fields to set this up.

    You’ll then need to customize the output of the plugin to include the video. The simplest method is likely to use the output filter to check for a custom parameter (ex: include_video=”true”) and if that’s present then include the video in the listing.

    Here’s a tutorial on using the output filter: https://www.billerickson.net/code/using-display-posts-shortcode-output-filter/

    Thread Starter LesTexas60

    (@lestexas60)

    HI Bill, Thank you for your response and instructions. I can try this is some circumstances but it doesn’t fit my main process.
    I use a plugin called Postie, that allows any authorized person to send an email to a pre-defined email address. That email can have text, images or a video. Postie checks the email address periodically and pulls the email into WordPress and creates a post with a Category. This allows non-tech people the ability simply update select Posts on their site. This is the first half and Display Post Short Codes is the second half. Your plugin then allows me to display the Posts/Content/Excerpts in a page. The two plugs play very well together. Since the entire front end of creating the Post is automated, I am limited to what settings can chosen. I use these two plug ins on a number of my non-profit websites. You might want to get a hold of Wayne at Postie and see if you two could expand the functionality to allow the display of video/audio in the excerpt. This would be a great enhancement. I am always recommending your two plugins. I have Elementor Pro and your plugin exceeds the functionality of their Display post because you can show and play the videos in Posts without going to the actual post page.
    Thanks for a great plug-in.

    Thread Starter LesTexas60

    (@lestexas60)

    one more quick question: You said “First, you’ll need to store the video in metadata rather than in the post content itself. ” I have looked for a way of doing this and I can’t find anything other than setting titles, description and other things about the video. How do you set the actual video as metadata?
    thanks for any help.

    Plugin Author Bill Erickson

    (@billerickson)

    Actually, you may be able to use this WordPress function: get_media_embedded_in_content()

    Something like this might work: https://gist.github.com/billerickson/f5b7b59d5644a52398a62bf240cd7c49

    You can then do [display-posts include_content=”true” only_media=”true”] and if the post contains media (image/video), it should replace the entire post content with just the media item.

    I haven’t tested this and have never used this function before, but hopefully that gets you close to what you want.

    Thread Starter LesTexas60

    (@lestexas60)

    Thanks Bill, that gives me a direction to work on.

    Thread Starter LesTexas60

    (@lestexas60)

    Just an FYI, I’m on WP 4.9.8 and I get a warning that your plugin is not tested wit this version. I tried using it on a test site with the current Elementor version and the posts would not display.
    Just wanted to let you know.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show Video in Excerpt?’ is closed to new replies.