0

I've been looking for a video plugin in the plugin depository but couldn't find one that I'm looking for.

Basically, I want visitors to be able to play the video in the home page but the issue here is that the home page is displaying post excerpts. So if I would just post the video as normal, it would be cut in the home page.

So I think I would need to hard code the video code of the plugin inside the loop in the home template file, like where $video is the the video file in the post.

Does anybody know a video plugin like this?

Or is there a work around here, like how to show video in the home page having post excepts.

Thanks.

2 Answers 2

0

The excerpt is not meant for content that is why it is called "the excerpt".

Instead use a plugin like "Vipers Video Quicktags" or "Youtube shortcode" and add it to a template file and you'll probably want to get the url via a post meta field.

for example ( using Youtube shortcode plugin and meta field called "video"):

$video = get_post_meta($post->ID, 'video', true);
echo do_shortcode('[youtube_sc url='$video']'); 
1
  • Yeah, this is what I was looking for! But I did need to change the quotes to read like this: echo do_shortcode("[youtube_sc url=$video]");
    – John
    Jul 23, 2011 at 18:06
0

My idea may be tricky to put in practice (hope not impossible!), but you can add a filter for the_excerpt or get_the_excerpt and, since you are in the loop you may be able to find the post ID using the global $post or query var in your function, then, get the entire content of the post, find the videos and add them at the beginning or at the end of the excerpt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.