Youtube URL in custom field (2 posts)

  1. atracksler
    Posted 2 years ago #

    I have a database of entries, each is a post. There is data in each post in a custom field, one of which is "video" which has the youtube url in it.

    Im trying to get the url to echo in my loop,

    <?php  if((get_post_meta($post->ID, "video", true))) { ?>
    <p><span class="youtube"><iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="344" src="http://www.youtube.com/embed/<?php echo get_post_meta($post->ID, "video", true); ?>	?wmode=transparent&fs=1&hl=en&modestbranding=1&iv_load_policy=3&showsearch=0&rel=1&theme=dark" frameborder="0" allowfullscreen></iframe></span></p>
    <?php } ?>

    the $video is not outputting anything. What am I doing wrong?

  2. atracksler
    Posted 2 years ago #

    Duh. I forgot to save the page before trying it out... the code above totally worked.

Topic Closed

This topic has been closed to new replies.

About this Topic