Shortcode for HTML5 video in posts
wordpress snippet
Adding the first snippet to the functions.php of your wordpress theme will create a new HTML5 video shortcode. Place the shortcode below in your posts to display your video.
snippet : PHPcopy
function html5_video($atts, $content = null) {
extract(shortcode_atts(array(
"src" => '',
"width" => '',
"height" => ''
), $atts));
return '<video src="'.$src.'" width="'.$width.'" height="'.$height.'" controls autobuffer>';
}
add_shortcode('video5', 'html5_video');
snippet : SHORTCODEcopy
[video5 src="http://your-site/videos/your-video.mp4" width="720" height="480"]
this months featured snippets
- Anonymous
- http://wpsnipp.com Kevin Chard
- http://www.cliffpaulick.com Cliff Paulick
- http://wpsnipp.com Kevin Chard
- http://www.cliffpaulick.com Cliff Paulick
- http://wpsnipp.com Kevin Chard






