Lazy load YouTube videos in WordPress with Shortcode (copy)

function yt_shortcode_function( $atts = array() ) { // set up default parameters extract(shortcode_atts(array( ‘id’ => ‘test’ ), $atts)); return ‘ <iframe width="560" height="315" src="https://youtu.be/'. $id .'?autoplay=1" srcdoc=" * { padding:0; margin:0; overflow:hidden; } html,body { height:100%; } img,span { position:absolute;…Continue reading