Gallery Image Sizes

Hi Guys,

I searched for this but maybe I’m missing it. This site I’m building: http://2016.mazmaniainc.com/boas/zipper-vests/ is using the Gallery Module to show the clothing that this client makes. The gallery works great, however, I’m using the sizing of “Small” which is just a bit too small, and the “Medium” is a good deal too large. The photo size when you click the image is perfect (but I sized the jpg files to that size).

Is there a way to change the default “small” size? If so, where and how? I just need them a little bigger.

Hi Mike,

The Gallery module has specific sizes set in the module code. However, if you like you can override these. What you will need to do is follow the instructions on our KB, which I have linked below.

http://forum.wpbeaverbuilder.com/custom-module-documentation/#override-built-in

Then open up the gallery.php file in your favourite code editor (I recommend Atom by GitHub or SubLime Text) then go to line 270 and change the size values there.

After completing this, you may need to use the regenerate thumbnails plugins.

Thanks,
Danny

Hi Danny,

Thanks. I guess I’m missing something. I followed the steps you suggested and I’m still not having any luck. My images are still 150 pixels wide and I changed the small size to 250 in the gallery.php file in my theme’s folder. I used Regenerate Thumbnails after I made the change as well.

Am I missing another place that it needs to be changed? Is this based on the padding or margins? The page not being wide enough?

Let me know.

Thanks,
Mike

Hi Mike,

Try clearing the Page Builder cache via WordPress Admin Dashboard > Settings > Page Builder > Cache.

Once cleared, load up the page builder, edit your Gallery module and then publish the changes again. See if this resolves your issue.

Thanks,
Danny

Well, it didn’t make the photos bigger, but there were 2 rows of 4 and now I have 3 rows. So it looks like they are taking up more space, but the images are the same size. So, I regenerated the thumbnails again, but didn’t help.

Hi Mike,

I believe the issue is that your images height is greater than its width. The setting is fo width and the height is adjusted accordingly.

So we can make sure your custom Gallery module is working. Can you upload a more squared image and see if the width is same as the setting in gallery.php.

Thanks,
Danny

Hi Danny,

This is really driving me crazy. The changes work, but in such a weird way. If I set my size for small to 300 they jump up huge. If I set it to 299 it goes right back to the small version. If I set it to 50 they get tiny, but it’s like this weird thing were there is no difference between 250 and 299 and then 300 the images jump up huge.

There has to be a way that I can get these images just a bit bigger than what they are defaulting to without getting huge, right?

Mike

Hi Mike,

Can you set your small size to 300 and then let me know, so I can take a closer look at their sizes.

Also, did you try my suggestion above with a squared image?

Thanks,
Danny

Hi Danny, I didn’t do the square image because they are resizing, they just do a weird jump in size from 299 to 300.

So, You want me to change the Small to 300 and then direct you to a gallery?

Hi Mike,

Just make the change to Small and I already have the link to your gallery.

Thanks,
Danny

ok. Changed small to 300 and you can see here how big they are:

http://2016.mazmaniainc.com/boas/cinch-back-jackets/

And on this one that hasn’t been updated yet how small they are set to 250.

http://2016.mazmaniainc.com/boas/long-capes/

The whole site is galleries of these jackets, vests, etc. I need to get them somewhere between the tow that you see above. Ideally 3 in each row.

Hi Mike,

Can you provide me with FTP access so I can take a look at your changes. As, the images don’t even have a width of 300 pixels which is what you said you set it to. They’re currently at 376px.

As well as FTP, can you provide temp admin access.

Thanks,
Danny

[Content Hidden]

Hi Mike and thanks for the info.

I am just awaiting some info from our developers. As I added your images to a test site of mine and played around with the values from the gallery.php file. It doesn’t appear to be based on image width as I first thought.

Therefore, as soon as I have more information, I will reply here. I apologise that this is taking longer than it should.

Also, I did notice that a few of images have different dimensions. I would recommend you edit your images so that they’re all uniform.

Thanks,
Danny

Thanks Danny. I do have to show this to the client by tomorrow. Can I change it back to the the 250? Smaller is probably better than huge.

Thanks.
Mike

Hi Mike,

I apologise, yes change it back if you like.

Also, I have spoken to our developers and they have confirmed what I suspected and that those values are the min-width of the images. Therefore, what is happening is like I mentioned above.

Where when you change the value, what happens is that the images width is set and the height is automatically calculated to the width of the image so that they remain in proportion.

I think the best course of action is for you to try and edit the images so that they have similar widths and heights. This is will make it much easier to manage.

If you wish to keep the image dimensions as they’re, we may need to try and use custom CSS to get your ideal size. However, this may cause some issues with the layout.

Thanks,
Danny

I’m a bit confused by the min-width thing. What width would I need to make them? Should they all be in the same size square? Thoughts?

This is what I did last year when it was just html. The size is much better. They’re not square images. All the same height, but different widths depending on how the model is standing. http://mazmaniainc.com/lw-jackets.html

Thanks in advance for any suggestions you may have.

Mike

Hey Mike,

I’d just like to chime in here. It seems the code Danny referred to above only changes the minItemWidth attribute of the jQuery plugin we’re using which controls the min-width of the column/wrapper the image is in, not the image the itself.

Can you change everything back to default, and instead, change the media sizes found under Settings > Media? If you’re using the medium size on the module, you’ll want to adjust the medium size in the media settings. Since your images are tall in nature, try adjusting the max-height on the setting.

Let us know how it goes! :slight_smile:

Ben

Hey Ben,

Thanks! That was it. I didn’t realize the media settings WP controlled the image size in galleries. I guess I should have, but just thought it was a BB thing.

Thanks so much. Thanks Danny for sticking with me.

Call this one complete!
Mike

No worries at all, Mike! Glad we could help! :slight_smile: Have fun with BB! :slight_smile:

Ben