Site logo

Archived topic

Problem with the gallery in WPML translations only

11 replies · Started by Torsten on March 5, 2022

Viewing posts 1–12 of 12

Hello,

unfortunately I can't find the cause that in the gallery the function.php extensions of the image sizes are not taken over.

Furthermore, the css block that reduces the mobile version from 768px from two to one column is also not adopted.

What needs to be adapted in Generatepress in connection with WPLM?

What am I missing?

Best regards

Torsten

Hi there,

what exactly is the issue ?
I checked the home page of your site and I did not notice any differences in the Gallery between English and Spanish

Hello David,

thank you.

The English (the basic version) is as it should be (desktop + mobile).

In Spanish, the desktop is also ok, but not the mobile ... here the css is not taken over. Also not the two entries in the function.php that add more image sizes.

Also in Spanish, the gallery in the tray and movable version should be 1 column.

This is very strange.

Best regards

Torsten

All cache is deactivated.

All images are translated into both languages.

Ok so the CSS issue, in the latests version of WP they changed the HTML of the gallery block, so change this CSS:

@media (max-width: 767px) {
    .wp-block-gallery .blocks-gallery-item {
        width: 100%;
        margin: 0;
        padding-bottom: 40px;
    }
}

to

@media (max-width: 767px) {
    .wp-block-gallery .wp-block-image,
    .wp-block-gallery .blocks-gallery-item {
        width: 100% !important; 
        margin: 0 !important;
        padding-bottom: 40px;
    }
}

The image attachment size - you can try using the Regenerate Thumbnails plugin to see if that updates them. If not I suggest you ask WMPL support what's going on

Thank you, this is going in the right direction.

But now every second image is smaller in size!

The function.php thing is very puzzling.

This must have some other reason.

The images in the gallery all have the same size when you download them.

The issue could be related to either:

a) WPML translating the media - you would need to check with them.

or

b) it could be the WP 5.9 updated Gallery Block is 'broken'
One way to check this, if you add a new gallery block to a test page, does it display the additional sizes ? And are those sizes selectable on that image?

It works now.

I have recreated the thumbnails.

Thank you very much for your support.

Glad to hear that!

This archived topic is closed to new replies.