This is a great little secret to rotate random videos in your post (using Viper’s Video Quick Tags) or on your home or sidebar pages. It all depends on a little Wordpress Plugin called Random Words by Ozh.
The secret is to select the Youtube videos you want in the rotation and enter them into a list kept by the Random Words plugin. When you choose a video only copy from the Youtube URL the last portion;
e.g. http://www.youtube.com/watch?v=DPYGFNIv_Ak
You would only use the portion in bold, the DPYGFNIv_Ak part of the url. Populate your list with the videos you like.
To place the videos into a blog post you would use Viper’s Quick Tags and set it up like this (my Random Word list is named ‘videos’)
[ youtube][ random:videos][/youtube ]
Simply hit RELOAD or REFRESH to change the video.
To use the Random Words plugin on your home page or sidebar it is as easy as adding this code to your php:
|
Downloadrandom.txt
|
|
1 2 3 4 5 6 7 8 9 |
<div class="video">
<h2>Click <A HREF="javascript:window.location.reload()">Refresh</A> To See A Different Video </h2>
<object width="300" height="250">
<param name="movie" value="http://www.youtube.com/v/<?php wp_ozh_randomwords('videos') ?>" />
<param name="wmode" value="transparent" />
<embed src="http://www.youtube.com/v/<?php wp_ozh_randomwords('videos') ?>" type="application/x-shockwave-flash" wmode="transparent" width="300" height="250">
</embed>
</object>
</div>
|
