Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joeybab3/1b47e7abfcedc115755849a57955c0c9 to your computer and use it in GitHub Desktop.
Save joeybab3/1b47e7abfcedc115755849a57955c0c9 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 my-4 embed-responsive-16by9\">" . $html . "</div>";
} else {
return $html;
}
}
add_filter('embed_oembed_html', 'bootstrap_embed', 10, 3);
@joeybab3
Copy link
Author

joeybab3 commented Jul 8, 2019

To be placed in functions.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment