Some time ago I did a post on how to use the WordPress Plugins Youtube Thumbnailer and WP Youtube together. Taking that one step further, what if you want to use your own thumnails for youtube videos, rather than the default ones?
You can easily modify the Youtube Thumbnailer plugin to do this.
You’ll need to name your own thumnails with the same name as the youtube shortcode they relate to.
For example, if you want to use http://www.youtube.com/watch?v=MbiEMrqT1Q0 the shortcode would be MbiEMrqT1Q0
You would name the picture you want to use as the thumbnail for that video: MbiEMrqT1Q0.jpg
Upload it to your server in the usual way. All of the thumbnails must be stored in the same folder for this to work. I’m going to assume that folder it http://yourdomain.com/thumbnails/
So your url for the thubmnail in this example would be http://yourdomain.com/thumbnails/MbiEMrqT1Q0.jpg
Now to edit the plugin…
On lines 109 and 151 of youtube_thumbnails_script.php, change where it says
$img=”http://i2.ytimg.com/vi/{$match[1]}/default.jpg”;
to be
$img=”http://yourdomain.com/thumbnails/{$match[1]}.jpg”;
where http://yourdomain.com/thumbnails/ is the folder for the thumbnails.
* Note: I haven’t tested this out – it was a question from a reader, but I can’t see any reason why it wouldn’t work as stated. If you have any problems, or you can confirm it works, please share it with us in the comments below. If you do a post confirming it works, please let me know and I’ll link to it from here.
Leave a Reply