WordPress by default will generate 3 types of image sizes: thumbnail, medium and large.
Since version 2.9, WordPress has added post thumbnail feature that allows us to add more image sizes in order to use them more flexibly. If you are running a image based website, like Wallpaper download site, it’s always good to list all registered image sizes to let the uses choose their preferred resolution.
Keep reading and you’ll find it’s such an easy task. And below is the screenshot of our final result.
All image sizes generated by
add_image_size function will be added to a global variable
Using global variable is not a good idea sometimes because someday WordPress will change it. Good news is that there is a function
get_intermediate_image_sizes that will return an array of available image sizes.
Just drop following codes to somewhere in the loop of your single.php or any other file that display the post content.
This function requires a featured thumbnail to work well, it will display all image sizes of the thumbnail. If no thumbnail set, nothing will display.