themes icon indicating copy to clipboard operation
themes copied to clipboard

Varia themes: Gallery Block: 2 columns showing stacked

Open jackiejade opened this issue 5 years ago • 23 comments

Describe the bug When a gallery block is added to a page or post and has 2 columns, the images are showing as stacked on desktop instead of side-by-side.

To reproduce Steps to reproduce the behavior:

  1. Go to Site > Posts (or Pages)
  2. Click on + to add a Gallery block
  3. Insert two images
  4. Set columns to 2 in block settings

Expected behavior Expect the images to display side-by-side (as they show in the editor) on the preview/live site.

Screenshots In the editor: preview in editor

Live site:(the image is large so I couldn't get the full thing in a screenshot) live site

Editor version (please complete the following information):

  • WordPress version: 5.5.1
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? default block editor

Desktop (please complete the following information):

  • OS: 10.14.6
  • Browser Firefox
  • Version 80.0.1

Additional context We have a temporary workaround with CSS thanks to Ed!

/* fix 2-column gallery item display on larger screens | #XXXXXX-hc eD */
@media screen and (min-width: 560px) {
	.wp-block-gallery.columns-2 .blocks-gallery-grid {
		flex-wrap: unset;
	}
}

After some testing, this was found in Exford, Mayland, Aleves, Leven, Balasana.

This issue did not persist in Seedlet or Radcliffe2 which leads me to believe it is a Varia bug.

Related issue: #25156

jackiejade avatar Sep 08 '20 16:09 jackiejade

Another report here: 23934217-hc

I can confirm that it only appears to apply to Varia-based themes. In addition to Seedlet and Radcliffe 2, Twenty Twenty also doesn't have an issue with the block. Barnsbury, Dalston, and Hever all do (in addition to those mentioned above).

ersatzpenguin avatar Sep 08 '20 21:09 ersatzpenguin

Another report here: 23985478-hc / 3301171-zen

Theme: Exford

The CSS solution didn't work for this one so I deactivated the Gutenberg plugin.

ccwalburn avatar Sep 09 '20 11:09 ccwalburn

In doing a bit more testing, the issue is with the math for the margins between the images -- this will fix that and scale better with more images in the Gallery, too:

/* fix 2-column gallery item display | #XXXXXX-hc/zen eD */
.wp-block-gallery.columns-2 .blocks-gallery-image, 
.wp-block-gallery.columns-2 .blocks-gallery-item {
	width: calc( (100% - 1em) / 2);
}

edequalsawesome avatar Sep 09 '20 21:09 edequalsawesome

Reported here #3288394-zen

nagpai avatar Sep 11 '20 05:09 nagpai

Two more in:

#3305826-zen (reported by @gwensmithx) #3311760-zen (reported by @charliescheer)

nielslange avatar Sep 13 '20 12:09 nielslange

Site Affected
WordPress.com Free Plan
WordPress.com Personal Plan
WordPress.com Premium Plan
WordPress.com Business Plan
WordPress.com eCommerce Plan
WordPress.org site

Corresponding code on WordPress.com Free Plan, WordPress.com Personal Plan & WordPress.com Premium plan:

.blocks-gallery-grid .blocks-gallery-image,
.blocks-gallery-grid .blocks-gallery-item,
.wp-block-gallery .blocks-gallery-image,
.wp-block-gallery .blocks-gallery-item {
    margin: 0 1em 1em 0;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

Corresponding code on WordPress.com Business Plan, WordPress.com eCommerce Plan & WordPress.org sites:

.blocks-gallery-grid .blocks-gallery-image,
.blocks-gallery-grid .blocks-gallery-item,
.wp-block-gallery .blocks-gallery-image,
.wp-block-gallery .blocks-gallery-item {
    margin: 0 16px 16px 0;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

Please note the different margin definitions between the plans.

nielslange avatar Sep 13 '20 13:09 nielslange

Deactivated Gutenberg to fix in #23618331-hc before I found this issue

kriskarkoski avatar Sep 13 '20 19:09 kriskarkoski

I created a fix here: https://github.com/Automattic/themes/pull/2456

scruffian avatar Sep 14 '20 12:09 scruffian

This should now be fixed on wpcom.

scruffian avatar Sep 14 '20 13:09 scruffian

This should now be fixed on wpcom.

The fix doesn't seem to work on wpcom, see https://greersrental.wordpress.com/explore-locally/. Would you mind taking another look, @scruffian. Is it possible that the change hasn't been deployed yet?

nielslange avatar Sep 14 '20 13:09 nielslange

Another issue in #23457559-hc

I can also confirm the issue persists on a personal test site of mine at https://premiumpeaeb.wordpress.com/ Screenshot: https://d.pr/i/mZH9cX

pauloeaquino avatar Sep 15 '20 01:09 pauloeaquino

@scruffian Can we have an update on this? Either the deployment or the fix failed.

nielslange avatar Sep 15 '20 03:09 nielslange

The issue is in all Varia child themes, but I only fixed the parent theme. I'm gradually getting the fix into all the child themes. I'll let you know when it's done.

scruffian avatar Sep 15 '20 15:09 scruffian

This should now be fixed on WPCOM for all varia child themes. Let me know if you're still having issues.

scruffian avatar Sep 15 '20 15:09 scruffian

@scruffian this issue still persists for the Maywood theme.

A user is reporting this in 3319080-zen. Maywood theme is active and the site is on a Premium plan. Screenshot of the gallery block within the editor: https://d.pr/i/vmKbGc .gif of the published post: https://d.pr/v/fC6QGx

I'm also able to replicate this issue on my test site on the same plan and theme as the user: Within the editor: https://d.pr/i/h7HVge .gif of the published post: https://d.pr/v/9OW9GV

The CSS @nielslange mentioned in https://github.com/Automattic/themes/issues/2455 gets things working though.

synora avatar Sep 15 '20 18:09 synora

@scruffian Feel free to test your fix against the following testing sites:

  • https://simple.nielslange.blog/2020/09/13/test-2437-gh-themes/ → Simple site and affected by this bug
  • https://atomic.nielslange.blog/2020/09/test-2437-gh-themes/ → Atomic site and not affected by this bug

⚠️ Please note that only simple sites are affected by this issue, while atomic and self-hosted sites are not affected.

nielslange avatar Sep 16 '20 04:09 nielslange

Sorry about that, I forgot to bump the version numbers for these themes. This should be fixed. Please let me know if it's not!

scruffian avatar Sep 16 '20 14:09 scruffian

Thanks for the fix, @scruffian. I can confirm that the fix is now live on wpcom. 🙌

nielslange avatar Sep 17 '20 03:09 nielslange

Today I had a chat with a user who had a similar issue. When the gallery block is set to 2 columns the images are stacked. As a workaround, I provided the CSS code provided on this thread earlier on: https://github.com/Automattic/themes/issues/2437#issuecomment-691669662 it worked.

The user's site is Atomic and they’re using the Anemone theme The user reported this here 30618829-hc and the follow-up is at 4220128-zen

I also tested on a personal site https://ps2345com.wordpress.com/gallery-with-description-and-a-button/ Screenshot or page without CSS code: https://d.pr/i/GJqvfR and Screenshot with CSS code: https://d.pr/i/XWiYJn

Thelmachido avatar Aug 13 '21 16:08 Thelmachido

Ran into this similar issue here: 32435222-hc | Follow up: 4410159-zd-woothemes User is on Premium Plan and Retired theme Arcane

Providing user with CSS workaround and noting that this likely won't be fixed in their theme, and we might not be able to provide such support in the future.

cuemarie avatar Oct 27 '21 21:10 cuemarie

Ran into a similar issue here: #4912843-zen It's an Atomic Site and the user is currently using the dyad-2 theme

Tweaked the CSS shared above, confirmed that it worked on the user's site, and shared the following with them:

/*Workaround for issue where 2-column gallery is showing with stacked images | #4912843-zen(zy)*/
.wp-block-gallery.has-nested-images.columns-default.is-cropped {
    flex-wrap: unset;
}

zyousafi avatar Apr 06 '22 15:04 zyousafi

5257135-zd

Applied custom CSS. Theme: Arcane Child.

.wp-block-gallery.has-nested-images.columns-default.is-cropped {
    display: flex;
    gap: 1em;
}

Jaykame avatar May 31 '22 03:05 Jaykame

@mrfoxtalbot I don't believe this one still needs fixing.

I tested on Varia, the original source of the issue, and it appears fine:

Screenshot on 2022-08-12 at 15-04-38

The Varia child theme Maywood was mentioned in the issue but that is also now working fine:

Screenshot on 2022-08-12 at 15-06-46

The last theme to be mentioned that wasn't retired is Dyad 2 but it looks okay there:

Screenshot on 2022-08-12 at 15-03-56

bobmatyas avatar Aug 12 '22 19:08 bobmatyas

Yup, it seems to be solved now. Thank you @bobmatyas!

mrfoxtalbot avatar Aug 19 '22 15:08 mrfoxtalbot