Created
October 26, 2013 01:42
-
-
Save FriendlyWP/7164332 to your computer and use it in GitHub Desktop.
Remove dimensions from oEmbed videos so that YouTube and other oEmbedded videos resize to fit device width. This only works for videos that use <a href="http://codex.wordpress.org/Embeds">oEmbed</a>.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VIDEO | |
// remove dimensions from oEmbed videos | |
add_filter( 'embed_oembed_html', 'tdd_oembed_filter', 10, 4 ) ; | |
function tdd_oembed_filter($html, $url, $attr, $post_ID) { | |
$return = '<figure class="video-container">'.$html.'</figure>'; | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment