Skip Navigation

[Resolved] Keep images fluid in view's grid

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Charles 6 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#593600

Nigel,

I wanted to open a new ticket to address another item.

I am using a view to displaying 20 posts per page. Each post has a featured image or slider followed by its excerpt and a few buttons. What's the best way to keep all the images in unison (height & width) while still being responsive?

Again, this is the site I am trying to emulate: uncrate.com

Thanks,
Chuck

#593951

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chuck

First, to when you create the View, use the Loop Wizard and the Bootstrap grid option to display the results in the required number of columns on larger screens. I think you are familiar with this already.

The key for keeping the images the same size is that the source images need to have the same aspect ratio. The size they are displayed will be determined by the available width. For the heights to be equal they don't need to be the same actual size, but they do need the same aspect ratio.

When you upload an image to WordPress it automatically generates various sizes of the same image. The standard built-in sizes won't crop the images so that they are the same size, the height and width serve as a maximum size.

You should add a custom image size that suits your needs and then you can use that size when outputting the images in your View.

If you are lucky your theme may already provide additional sizes that suit your needs, otherwise you will need to do it yourself.

The official documentation for that is here: https://developer.wordpress.org/reference/functions/add_image_size/

If you need more help there are lots of tutorials out there. This one is pretty comprehensive: hidden link

Of course you wouldn't need to do this if all of the images are uploaded to the site with the same aspect ratio, but using this approach will ensure that the images are the same height even if they were uploaded in a variety of sizes.

#594101

Got it.

I'll have to make sure all of my images are the same aspect ratio.

Appreciate your help again.

Best,
Chuck