Responsive | Type: PHPResponsive Video Embeds

One of the ways to make video pasted into the editor responsive.

In evo-better-cms.php or functions.php:
//make video embeds responsive; add a container
add_filter( 'embed_oembed_html', 'custom_oembed_filter', 10, 4 ) ;
function custom_oembed_filter($html, $url, $attr, $post_ID) {
    $return = '<div class="video-container">'.$html.'</div>';
    return $return;
}

In CSS:
/**embedded video - paste youtube URL directly into editor**/
.video-container { width:100%!important; height:auto!important; padding: 7px 0 1.6em 0; }

We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept