Skip to content

Instantly share code, notes, and snippets.

@dougedgington
Last active September 4, 2015 03:34
Show Gist options
  • Save dougedgington/57c58ff8e7c8926b686b to your computer and use it in GitHub Desktop.
Save dougedgington/57c58ff8e7c8926b686b to your computer and use it in GitHub Desktop.
<?php
//* Shortcode to output video embed with responsive wrapper
function dee_video($atts, $content = null) {
extract(shortcode_atts(array(
'width' => '500',
), $atts));
$output = '<div class="video-container" style="max-width:' . $width . 'px;">';
$output .= '<div class="responsive-video">';
$output .= $content;
$output .= '</div></div>';
return $output;
}
add_shortcode( 'responsive-video', 'dee_video' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment