Wordpress - YouTube Custom Post Meta


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* CUSTOM POST FOR YOUTUBE VIDEO */
  2. <?php if(get_post_meta($post->ID, 'youtubeVideoID', true)): ?>
  3.  
  4. <iframe width="480" height="390" src="http://www.youtube.com/embed/<?php echo get_post_meta($post->ID, 'youtubeVideoID', true); ?>?rel=0" frameborder="0" allowfullscreen></iframe>
  5.  
  6. <?php endif; ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.