By default WordPress generates a series of thumbnail sizes every time you upload a new image. Small, Medium and Large are the most common and you can specify what Small, Medium and Large actually mean in pixels under Settings > Media.

This is good, but sometimes you just need more than three sizes, so here is how to tell WP to create an additional thumbnail every time an image is uploaded. It’s quite simple, this is the function you have to add in your theme’s functions.php file

And this is how you call the new image size in your theme’s template

It really is that simple!

Tip #1: the_post_thumbnail() function will output something like this

so you dont need to write the img tags in your code.

Tip #2: Remember you’ll need to regenerate the thumbnails for all the images that are already uploaded to your site. This will only apply to the images you upload from here on as the thumbnail creation process happens by default during the image upload.