-1

Hello in index loop 3 lastest post and i want to take only a bit o text and first photo or youtube - and here is the problem, because i can use the_excerpt or i can use get_post_meta to take text, to take picture i can use the_post_thumbnail but i have no idea how i can get youtube as player with the movie, it's always going as text...

 <div class="article-image">
<div class="opis-article">
<?php echo the_excerpt(); ?>
<div class="art-en"><h2><a href="<?php the_permalink(); ?>"><?php echo get_post_meta($post->ID, 'tytul-en', true); ?></a></h2><p><?php echo get_post_meta($post->ID, 'en', true); ?></p><span><a href="<?php the_permalink(); ?>">read more</a></span></div>
<div class="art-pl"><h2><a href="<?php the_permalink(); ?>"><?php echo get_post_meta($post->ID, 'tytul-pl', true); ?></a></h2><p><?php echo get_post_meta($post->ID, 'pl', true); ?></p><span><a href="<?php the_permalink(); ?>">czytaj więcej</a></span></div>
</div>
</div>

any idea ?

closed as unclear what you're asking by TheDeadMedic, Johannes Pille, birgire, Pieter Goosen, Nicolai Sep 5 '14 at 11:17

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you provide simplified example of what post content would be and what you would like to retrieve from it? I guess you are talking about oembed here, but it is a little hard to follow your question. – Rarst Sep 1 '14 at 14:29
1

You could initialize the video shortcode - [video] - with the function do_shortcode. Exemplary usage would be like this:

echo do_shortcode( '[video src="your-source-file.mp4"]' );


Extra information:
I have given an extensive answer to a similar question a couple of weeks ago. You should take a look I'm certain it will help you out. Especially if you still need to grab the source from the content. Additionally it offers another possibility to display the video.

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