Bootstrap in WordPress – Responsive YouTube Videos

If you use a BootStrap Theme, then you should use the feature of responsive Videos.

Check out the video below

[bootube src=””]

function bootstrap_youtube( $atts ) {
    $a = shortcode_atts( array(
        'src' => '',
    ), $atts,'bootube' );
	return strlen($atts['src']) ? '
<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="' . $atts['src'] . '"></iframe></div>
<div style="clear:both;""></div>
' : '';
add_shortcode( 'bootube', 'bootstrap_youtube' );

Now check out the usage


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: