bux23
11/25/2016 - 1:18 PM

WP SHORTCODES

WP shortcodes

//////////////////////////////////////////////////////////////
///////// VIDEO SHORTCODE
//////////////////////////////////////////////////////////////
function ins_video($atts) {
	$shortcode_atts = (shortcode_atts(array(
      'name' => "Assistenza-Caldaie-Roma_-ITC-srl-Roma",
    ), $atts));
    $name = $shortcode_atts[ 'name' ];
	$vid= '<div class="wpt_video_container" >
		     <video controls width="100%" height="100%" preload="none" style="background-image:url('.get_site_url().'/wp-content/uploads/videos/'.$name.'.jpg);">
			 <source src="'.get_site_url().'/wp-content/uploads/videos/'.$name.'.mp4" type="video/mp4" />
			 <source src="'.get_site_url().'/wp-content/uploads/videos/'.$name.'.webm" type="video/webm" />
			 <source src="'.get_site_url().'/wp-content/uploads/videos/'.$name.'.ogg" type="video/ogg" />
			 <p>Il tuo browser non supporta questo video</p>
			 </video>
		   </div>';
	return $vid;
}
add_shortcode('ins_video','ins_video');