Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created October 22, 2011 04:11
Show Gist options
  • Save whyisjake/1305609 to your computer and use it in GitHub Desktop.
Save whyisjake/1305609 to your computer and use it in GitHub Desktop.
Simple YouTube Embederator
<?php
function make_youtube_embed($width,$height) {
global $wp_query;
$big_video = get_post_custom_values('Big Video');
?>
<object width="<?php echo $width; ?>" height="<?php echo $height; ?>">
<param name="movie" value="http://www.youtube-nocookie.com/v/<?php echo $big_video[0]; ?>?showinfo=1&version=3&amp;hl=en_US&amp;hd=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="transparent" />
<embed
src="http://www.youtube-nocookie.com/v/<?php echo $big_video[0]; ?>?showinfo=1&version=3&amp;hl=en_US&amp;hd=1"
type="application/x-shockwave-flash"
width="<?php echo $width; ?>"
height="<?php echo $height; ?>"
allowscriptaccess="always"
wmode="transparent"
allowfullscreen="true">
</embed>
</object>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment