Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* THEME USAGE:
- [video id="dIDcs0p19OQ" width="400" height="300" class="sampleclass"]
- */
- add_shortcode('video', 'video_func');
- function video_func($atts, $content) {
- extract(shortcode_atts(array(
- 'id' => NULL,
- 'width' => '400',
- 'height' => '300',
- 'class' => 'video-frame',
- ), $atts));
- if(!$id) return "<!-- No [video] id found -->";
- $output = "<div class='vidframe $class'><iframe width='$width' height='$height' src='http://www.youtube.com/embed/$id?rel=0' frameborder='0' allowfullscreen></iframe><div class='vidframe-caption'>$content</div></div>";
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement