Last active
September 4, 2015 03:34
-
-
Save dougedgington/57c58ff8e7c8926b686b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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