Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using "Lightbox Plus" plugin to create lightbox image overlay on the top of thumbnail galley. Now my question is how I can set a size for Thumbnails without affecting on the lightbox image overlays. I mean when I try to set a scale for Thumbnails through wp-Gallery edit option it apply the size even to the overlays (I would like to keep the overlay size as big as possible but this function makes them small like Thumbnails size) I also see this line of code in codex:

 `get_the_post_thumbnail($id, array(100,100) ); // Other resolutions`

but I don't know how and where to use it.

Thanks

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Use add_image_size():

add_image_size( 'custom-name', 123, 456, true );

...will create image size custom-name, with dimensions of 123x456px, hard-cropped.

Edit

Re this comment:

Thanks for comment but honestly I got more confused!can you please let me know what is the 'custom-name'? How I can associate this name with Gallery thumbnails?

The custom-name is arbitrary. It's whatever you want it to be. You could call it gallery-thumb, if you want to:

add_image_size( 'gallery-thumb', 123, 456, true );

Then, you would output that image size by passing gallery-thumb to the_post_thumbnail():

the_post_thumbnail( 'gallery-thumb' );

In your case, I assume you're using the core WordPress [gallery] shortcode? If so, you can pass the size attribute:

[gallery size="gallery-thumb"]
share|improve this answer
    
Hi Chip, Thanks for comment but honestly I got more confused!can you please let me know what is the 'custom-name'? How I can associate this name with Gallery thumbnails? –  Behseini Jan 29 '13 at 22:02
    
Please see updated answer. :) –  Chip Bennett Jan 29 '13 at 23:17
    
Thanks Chip I got it and it is working now. –  Behseini Jan 30 '13 at 7:15

Your Answer

 
discard

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.