Post Thumbnails are getting more popular every day. Many magazine themes associate an image with a specific post which they later display on either homepage or on the post page. We display a thumbnail with our posts on both the post page and the category page. In older versions, this functionality was obtained with the use of custom-field method which was not very user friendly. Thanks to WordPress Core Developers along with many notable features in WordPress 2.9, this function was also added to the core.
Simply watch the video or read the tutorial below
You will see an option like this in the sidebar of your Write Post Panel in WordPress Dashboard.
Click on the link, and you will be taken to an upload image page. Upload the picture, and you will see something like this:
Just click on the link that says use it as thumbnail. Once you do that, you will see a screen like this:
The above screen means, that you are done. Simply click publish and the image will show on your site.
Even though this functionality is added to the core, not every user will see this option in the sidebar of their write post panel. This is one of those functions that can be enabled only if the theme supports it. Older free themes might not support it, so you would need to ask the developer to update, or you can do it yourself by following this tutorial.
First you will need to open your functions.php file in your themes folder and paste the following code:
add_theme_support( 'post-thumbnails' );
This code will enable theme support for both posts and pages. So now you will be able to see an option in your dashboard. But it will not display in your themes because we have not added the code in the theme yet.
You can display the thumbnail anywhere inside the Loop by using this code:
<?php the_post_thumbnail(); ?>
That was the basic function, but if you want to get more advanced such as specifying post thumbnail size then you will just need to open your functions.php file and paste the code like this:
add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 50, 50, true );
The dimensions are set in this order: width x height and these are pixels.
You can also add additional image sizes for your featured image by adding this line:
add_image_size( 'single-post-thumbnail', 590, 180 ); // Permalink thumbnail size
You can later call the specific thumbnail sizes in your post loop like this:
<?php the_post_thumbnail('single-post-thumbnail'); ?>
This is broken down version of the full functionality of this feature. We tried to keep it simple, so every one can follow it. If you want more information on this functionality then check out: