Navigation überspringen

[Gelöst] Resizing Gallery Images from Square to 16:

This support ticket is created vor 3 Jahre. 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 5 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von PaigeH5854 vor 3 Jahre.

Assistiert von: Minesh.

Author
Artikel
#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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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.
versteckter Link

#2378619

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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!