Created
August 30, 2016 04:46
-
-
Save hirejordansmith/f47a4dab09bac005e9cbf75babe8e5ec to your computer and use it in GitHub Desktop.
Simple Responsive Video Shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// [yvideo vid="4mEbABPtTv8" /] | |
add_shortcode( 'yvideo', 'hjs_do_video' ); | |
function hjs_do_video() { | |
$atts = shortcode_atts( array( | |
'vid' => '' | |
), $atts, 'yvideo' ); | |
return '<div class="embed-container"><iframe src="https://www.youtube.com/embed/' . $atts['vid'] . '" frameborder="0" allowfullscreen></iframe></div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment