Posts as Youtube Thumbnails
You can use the custom fields to accomplish this.
First, create a custom field in one of your posts. Name the 'Key' somethings like 'video_id' (without quotes) and in the 'Value' field, put the ID of the youtube video:
So if your embed code looks like this:
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/uug6TjvRJaE&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/uug6TjvRJaE&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
the Custom Field would be Key=video_id and Value= uug6TjvRJaE
After creating the custom field, create a new page template (eg. video_thumbs.php) NOTE: you can alter your index.php file directly, but I would advise testing on a page first.
In that new page, copy and paste all of the contents of your index.php. Then replace the loop with this code:
<?php if (have_posts()) : ?>
// this is where the module begins
query_posts('showposts=1&cat=199'); ?> //change the showposts number to the number of posts that you want to appear, and change cat=199 to your category number (or remove), which you can find out by going to Manage > Categories
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="http://s2.ytimg.com/vi/<?php
// this is where the custom field prints images for each post
$values = get_post_custom_values("video_id"); echo $values; ?>/default.jpg" alt="<?php the_title(); ?> Thumbnail" /></a>
<p class="title"><a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?></a>
<?php endwhile; ?>
Only replace the code between
<?php if (have_posts()) : ?> and
<?php endwhile; ?>
Save and upload to your server. Then create a new page and set it to use the video_thumbs.php template. Navigate to this page and viola!
You must add a 'video_id' custom field to any post that you wish to have a thumbnail.
With the example above each entry will be given a div class of 'thumbnails'. You can call that whatever you want, as well as style it appropriately.
Of course, when you have your desired results you could use 'is_home' conditional tags to incorporate this into your index.php file.
This works for me. Just figured this out for myself and I was so happy that I had to share. I knew people would love to hear my solution.
And just so you know, the link to a thumbnail for any youtube video is http://s2.ytimg.com/vi/VIDEO_ID/default.jpg (where 'video_id' is the youtube id - eg: http://s2.ytimg.com/vi/uug6TjvRJaE/default.jpg)
Let me know how it goes. May end up turning this into a simple plugin.