Passer la navigation

[Résolu] Resizing Gallery Images from Square to 16:

This support ticket is created Il y a 3 années. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 5 réponses, a 2 voix.

Dernière mise à jour par PaigeH5854 Il y a 3 années.

Assisté par: Minesh.

Auteur
Publications
#2375759
Gallery Proportions.jpg

Hi There,

We're using an Image Gallery to display photos. It seems that the default size for the images output by the image gallery is a square, maybe a 4:3 ratio. I need to change the output to a 16:9 ratio, more rectangular. Can you advise how this can be done? See an attached example.

Thank you.

#2376123

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

For that layout, you'll have to adjust the height of the cell using custom CSS.

Can you please share problem URL where you want to display the resized layout?

#2376659

Here is an example page. The gallery is about halfway down the page. Thank you.
lien caché

#2378619

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Could you please try to add the following CSS code to your view's CSS box:

.tb-gallery .tb-gallery--grid .tb-gallery__cell .tb-brick__content > a > img {
    object-fit: contain;
}

.tb-gallery .tb-gallery--grid .tb-gallery__cell,
.tb-gallery .tb-gallery--grid .tb-gallery__cell .tb-brick__content {
    height: auto;
}

.tb-gallery .tb-gallery--grid .tb-gallery__cell::before {
    padding-bottom: 50% !important;
}

I hope the above CSS code will help you to resolve your issue.

#2379143

Thank you, this was perfect! Best Regards!

#2379145

My issue is resolved now. Thank you!