WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a wordpress users that aren't very good at resizing images so when they upload an image to wordpress it's still big > 3000px.

They can import into a post and a thumbnail is generated. When you click on the thumbnail the image appears in a light box (using fancybox) but because the image is so big it takes ages to load.

Is it possible to open a smaller version of the image (say 800px wide) in the lightbox? Automatically, without the user having to resize the image before uploading?

Is there a plugin for this?


share|improve this question

migrated from stackoverflow.com May 16 '11 at 8:22

This question came from our site for professional and enthusiast programmers.

What you will need to do is edit your theme's functions.php file to add a new image size. Scroll to the bottom and inside the php tags enter:

add_image_size( 'fancybox-full', 800, 9999 );

This will create an uncropped image 800px wide, whenever an image is uploaded.

You will then need to edit the anchor for your images to link to this new image size. Try using wp_get_attachment_image_src() - use fancybox-full as the image size argument, not sure how yours currently gets the attachment ID, so if you need further assitance, let me know.

You will find this doesn't currently work with the images you have already uploaded. Try using the Regenerate Thumbnails plugin.

Hope this helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.