Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode( 'mi_rand_yt', 'rand_so_25319303' );
- function rand_so_25319303( $atts, $content = null )
- {
- $varRandom = rand(0, 2);
- $miSrc;
- if($varRandom == 0){
- $miSrc = "pathToYoutube1";
- }
- elseif($varRandom == 1){
- $miSrc = "pathToYoutube2";
- }
- elseif($varRandom == 2){
- $miSrc = "pathToYoutube3";
- }
- $output= '<div class="wpb_video_widget wpb_content_element">
- <div class="wpb_wrapper"><div class="wpb_video_wrapper"><iframe width="500" height="375" src="'.$miSrc.'" frameborder="0" allowfullscreen></iframe></div>
- </div>
- </div>'
- ;
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement