• Resolved seansean11

    (@seansean11)


    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 which actually works pretty well for generating thumbnails on-the-fly.

    However, I have always been confused by the option 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)
  • 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

    (@seansean11)

    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.