Skip to content

Instantly share code, notes, and snippets.

@javiergbas
Created January 28, 2016 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javiergbas/51f5d63ac8c7b3f45caf to your computer and use it in GitHub Desktop.
Save javiergbas/51f5d63ac8c7b3f45caf to your computer and use it in GitHub Desktop.
Automatic responsive videos with bootstrap
<?php
// responsive videos
function oembed_filter( $output, $data, $url ) {
$return = '<div class="video-wrapper"><div class="embed-responsive embed-responsive-16by9">'.$output.'</div></div>';
return $return;
}
add_filter('oembed_dataparse', 'oembed_filter', 90, 3 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment