I used WordPress’ get_the_post_thumbnail() function in order to output the current post’s featured image. It was great, until I had to link to the featured image. To do that, I needed the value of the SRC attribute of that IMG tag, i.e., the direct link to the featured image.
Thanks to phpxref, and the WordPress Codex, I managed to write a small useful function just for that. Without further ado, I present to you, the function:
function oy_get_direct_thumbnail_link( $post_id = NULL ) { global $id; $post_id = ( NULL === $post_id ) ? $id : $post_id; $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full'); $src = $src[0]; return $src; }
The first and only parameter ($post_id) is optional. If used inside the loop, it fetches the current post’s ID by itself.
Search terms:- get post featured image
- get featured image
- featured image link
- get featured image from post
- post featured image
- get featured image post
- get featured image of post
- get_posts featured image
- get_post_featured_image
- get_post featured image
I’ve received many emails complaining that the plugin does not recognize YouTube videos. Because of lack of time, I delayed the update until now.
I just released an update to the plugin which should solve most of the issues that I was contacted about.
Go ahead and download the new version:
http://wordpress.org/extend/plugins/youtube-thumbnailer/
- thumbnailforexcerpts plugin youtube
- how does a thumb nailer work?
- youtube video thumbnail does not show up in facebook
- youtube thumbnailer plugin settings wordpress
- youtube thumbnail plugin
- wp youtube plugin thumbnailer
- wordpress youtube thumbnail embed preg
- wordpress video embed custom field thumbnail
- wordpress plugin youtube thumbnail to facebook
- thumbnailer plugin
I have received a request from someone that wants even more from my WordPress Custom Fields Plugin. He has a category called “videos” which has posts with YouTube videos embedded with some plugin. He wants to put the videos thumbnail as the post’s thumbnail.
First, how is the video embedded in the post? It uses the following syntax:
Now you can embed it like you would normally do.
Second, how do we get the thumbnail itself after we extracted the video key? We build the image’s URL with the following syntax:
http://i2.ytimg.com/vi/$video_key/default.jpg
Now, how do we put all of this together into a plugin that inserts the thumbnails?
You don’t have to because I have already done it for you.
- Visit the plugin page of YouTube Thumbnailer
- Download the plugin here
- Unzip it’s contents
- Upload the folder you unzipped to
/wp-content/plugins/using your favorite FTP client. - Go to your admin panel and activate the plugin called “Youtube Thumbnailer”
This plugin runs through the posts in your blog and if it finds a YouTube video embedded in a post it sets the thumbnail to be the video’s thumbnail.
That’s it, have fun playing with the configuration.
If you encounter any issues please comment/contact me.
Search terms:- youtube thumbnailer
- youtube thumbnail script
- youtube embed custom thumbnail
- wordpress plugin youtube thumbnail
- youtube thumbnailer plugin
- Youtube Thumbnailer wordpress
- youtube thumbnail script code
- youtube thumb script
- wordpress youtube script
- custom thumbnail for embedded youtube

