Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.