Skip to content

Instantly share code, notes, and snippets.

@martinjohnyoung
Last active October 20, 2016 15:38
Show Gist options
  • Save martinjohnyoung/45f7f18dbe779e20fba6 to your computer and use it in GitHub Desktop.
Save martinjohnyoung/45f7f18dbe779e20fba6 to your computer and use it in GitHub Desktop.
Add a wrapper around oembed objects in WordPress. Should be added to your theme's functions.php
<?php
function funkshun_responsive_videos($html, $url, $attr, $post_id) {
return '<div class="video-wrapper">' . $html . '</div>';
}
add_filter('embed_oembed_html', 'funkshun_responsive_videos', 99, 4);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment