Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wwdboer
Created January 15, 2015 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wwdboer/643e7cdec902131d8c8e to your computer and use it in GitHub Desktop.
Save wwdboer/643e7cdec902131d8c8e to your computer and use it in GitHub Desktop.
WordPress Bootstrap responsive embed
/**
* Wrap embed html with bootstrap responsive embed div
*/
function bootstrap_embed( $html, $url, $attr ) {
if ( ! is_admin() ) {
return "<div class=\"embed-responsive embed-responsive-16by9\">" . $html . "</div>";
} else {
return $html;
}
}
add_filter( 'embed_oembed_html', 'bootstrap_embed', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment