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/
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.
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.
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.
Thanks Bill, that gives me a direction to work on.
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.