Post thumbnail is a theme feature in wordpress. Thumbnail is basically an image which represents the post or page of a website. This feature of wordpress was introduced in 2.9 versions. When you add
the_post_thumbnail(); in your theme it will display the featured image you mentioned during creating post. If you didn’t specifically mentioned any specific image as featured thumbnail then by default it will get first image in the post and set as featured image for the Post.
Default theme of wordpress have by default support for featured thumbnail support. You can it very easily that whether your theme supports featured thumbnail or not. If your theme supports this function then it must have following code in your function.php file.
add_theme_support( 'post-thumbnails' );
There are some default thumbnail size available in the word press. You can also use them if these meet your website requirements.Following are the default thumbnail sizes. These are by default available in wordpress.
the_post_thumbnail('thumbnail'); the_post_thumbnail('medium'); the_post_thumbnail('large');
As we are here to add a new thumbnail size so we will discuss now how to add new thumbnail size for specific post category. For example you assign a specific image size to thumbnail for portfolio category. You had to post following code in your theme’s function.php file.
add_image_size( 'portfolio-thumb', 540, 842 ); //540 pixel width and 842 pixel height
Now where ever you want to add thumbnail code for portfolio category in your wordpress theme. You will add code mentioned above. As you can easily see 540 and 840 are the width and height in pixels. You can change these according to your requirements. But be sure set the width and height of thumbnail by keeping mind the oprignal size of the image. if you didn’t set your thumbnail size properly your image may appeared blurry or extra cropped.
So that is all i hope you fully understand it. Its not such a difficult task. Feel free to ask any question if you want.