Title: Passing A Size (Array) to the_post_thumbnail Function
Last modified: August 21, 2016

---

# Passing A Size (Array) to the_post_thumbnail Function

 *  Resolved [seansean11](https://wordpress.org/support/users/seansean11/)
 * (@seansean11)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/passing-a-size-array-to-the_post_thumbnail-function/)
 * Hey,
 * I’ve been recently testing out different variations of resizing images in WordPress,
   in my quest to create post thumbnails without having to generate an extra uploaded
   image by means of “add_image_size” in functions.php. This has led me to tools
   such as [WPthumb](http://wordpress.org/plugins/wp-thumb/) which actually works
   pretty well for generating thumbnails on-the-fly.
 * However, I have always been confused by the [option](http://codex.wordpress.org/Function_Reference/the_post_thumbnail#Thumbnail_Sizes)
   that is available to pass a “size array” to the post thumbnail function.
 * Ex:
    `<?php the_post_thumbnail( array(100,100), true ); ?>`
 * I’m pretty sure WordPress claims to not have built in on-the-fly image generation,
   so I don’t understand what this function is actually doing behind the scenes.
   Could I actually use this for on-the-fly generated images? Since I’m not using
   a registered image size, how is it resizing the image, and where is it being 
   stored?
 * Thank You,
    Sean

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/passing-a-size-array-to-the_post_thumbnail-function/#post-4046685)
 * I believe that the parameter just adds ‘height’ and ‘width’ attributes to the
   img tag, and causes the resizing to be done by the browser. The resized image
   is not stored.
 *  Thread Starter [seansean11](https://wordpress.org/support/users/seansean11/)
 * (@seansean11)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/passing-a-size-array-to-the_post_thumbnail-function/#post-4046689)
 * Your’e right…. I can’t believe I didn’t notice that. It isn’t actually a cropped
   image that is being output. Seems as though I will need to just find the right
   balance between registering new image sizes in WP and on-the-fly methods. Too
   bad you can’t just register image sizes for certain post types or pages.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Passing A Size (Array) to the_post_thumbnail Function’ is closed to new
replies.

## Tags

 * [crop](https://wordpress.org/support/topic-tag/crop/)
 * [images](https://wordpress.org/support/topic-tag/images/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [seansean11](https://wordpress.org/support/users/seansean11/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/passing-a-size-array-to-the_post_thumbnail-function/#post-4046689)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
