Site logo

Archived topic

Gallery problems after update to WP 6.1

15 replies · Started by Gerald on November 2, 2022

Viewing posts 1–15 of 16

Hi,

I'm using generate press pro. After doing the wp update (6.1) this morning, my galleries don't work fine anymore.

I did 3-column-galleries, which are shown in the backend. In the frontend there are only one-column-galleries, with no gap between the photos.

Switched my website to another theme. No problems with the presentation of the galleries.

For example - here is a link, where you can see my problem:

https://music-on-net.de/johanna-borchert-jazz-and-the-city-2022-fotos/

Hope, you can help.

Best regards Gerald

Hi there,

if you edit that gallery block, and check its block settings, what are the settings set to ?

Hi,

set to 3 columns.

Possible to send you a screenshot?

What happens if you change that setting and save the page ?

It's the same problem.
At the moment you can see in the backend two columns, in frontend one column on the left side.

Odd, so the core blocks load some of their global styles inline in your site.
I can see that inline style loading on your site but its missing this:


body .is-layout-flex {
    display: flex;
    flex-wrap: wrap
}

If you have an cache plugins or server side caches, can you try clearing them?

If its still an issue the add the above CSS to your site.

Hi David,

after adding the css: it works!

Thank you for your help!

Best regards

Gerald

You're welcome!

Hi,

Same problem here. At least 4 websites with the same problem.

Adding the extra CSS solved the problem.

Now I wonder what caused the problem?

J

Its not the first time a WP update has messed with the core blocks styles or HTML. And the Gallery block has been one to change several times now.

What happens if you add a new Gallery block to a test page without that CSS being added ? Does that one load correctly ?

So when I add an new Gallery block to a test page without that CSS being added, the page does not load correctly.

Expected behaviour: gallery in three columns on desktop

Actual behaviour: all images in one column without any padding

What i do understand is that WP 6.1 moved certain block specific CSS styles into helper classes such as is-inline-flex.
And the relevant styles are loaded by WP in the global-styles-inline-css stylesheet inline in the <head> of your site.

And those styles for me have updated correctly on every site i maintained that i upgraded to 6.1
In yours and the OPs instance it seems that is not the case, and the styles are missing.

Thoughts ....
On a block based theme, the content of the global-styles-inline-css can be dictated by theme.json, on a traditional PHP theme like GP, that is not the case.

So - question do you have any custom functions on the site related to Theme Supports or theme.json?

I had the same issue, and even more weird at the galleries did show up correctly when I'm logged in but did break for not-logged-in users.

My solution that eventually works is putting the css for body .is-layout-flex into the "custom css" area of the (child-)theme's customizer.

Glad to hear that.
Question - are you using Autoptimize or any other optimization plugins that disable the core Block Library Styles ?

I'm using the "Asset CleanUp Pro" plugin with a pretty complex configuration. So just to be sure I don't overlook anything, I completely disabled the plugin for testing purposes and the gallery issue was still there.

This archived topic is closed to new replies.