Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

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']'); 
share|improve this answer
    
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 '11 at 18:06
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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