FriendlyWP
10/26/2013 - 1:42 AM

Remove dimensions from oEmbed videos so that YouTube and other oEmbedded videos resize to fit device width. This only works for videos that

Remove dimensions from oEmbed videos so that YouTube and other oEmbedded videos resize to fit device width. This only works for videos that use oEmbed.

// 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;
}