Skip to content

Instantly share code, notes, and snippets.

@erezLieberman
Last active August 29, 2015 13:57
Show Gist options
  • Save erezLieberman/9813398 to your computer and use it in GitHub Desktop.
Save erezLieberman/9813398 to your computer and use it in GitHub Desktop.
youtube player from acf field
<?php if (get_field('youtubeURL')) {
$mystring = get_field('youtubeURL');
$parts = explode("=",$mystring);
$mystring = $parts['1']; ?>
<div class="videoWrapper">
<iframe width="100%" height="450" src="//www.youtube-nocookie.com/embed/<?php echo $mystring ; ?>?html5=1" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment