Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#15103 closed defect (bug) (fixed)

Twenty ten 2 column gallery behaves as a three column gallery

Reported by: lessbloat Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Gallery Keywords: has-patch commit
Focuses: Cc:


To reproduce:

1) Activate twenty ten theme in either WP.org, or WP.com
2) Add a new post
3) Insert a 2 column gallery (tested with 4 images in gallery) into your post
4) Publish and preview your post.

Expected: While there ARE only two columns of images (as expected), the image containers themselves (div.gallery-item) need to be set to { width: 50% }

Actual: they are currently set to { width: 33% }, causing images to overlap.

Attachments (3)

15790-gallery-styles.diff (1.1 KB) - added by iandstewart 10 years ago.
15790.2.diff (1.2 KB) - added by nacin 10 years ago.
15790.3.diff (665 bytes) - added by lancewillett 10 years ago.
Refreshed patch with only the CSS rules

Download all attachments as: .zip

Change History (16)

#1 @westi
10 years ago

  • Milestone changed from Awaiting Review to 3.1

#2 @iandstewart
10 years ago

  • Cc ian@… added

Attaching a patch that adds additional classes to galleries and styles in Twenty Ten to take advantage of this. The extra classes would be useful for any theme that wants specific styles for galleries--especially ones with multiple layouts.

10 years ago

#3 @nacin
10 years ago

  • Keywords has-patch added

The gallery_style filter should die a slow and painful death. Here's one potential implementation.

We may also wish to add a gallery_div filter but I'm not sure which parameters to pass beyond what is already used to generate the ID and classes.

#4 @nacin
10 years ago

Closed #14186 as a duplicate.

#5 @lancewillett
10 years ago

  • Cc lance@… added

#6 follow-up: @nacin
10 years ago

  • Keywords commit added

Running with this. Here's what I'm doing:

  • gallery_style is going to be be broken down as seen in the patch, with a use_default_gallery_style (true/false).
  • the columns class will be added to the div.
  • gallery_style will still wrap the entire output, begrudgingly.
  • Twenty Ten will then need to leverage use_default_gallery_style. Additionally, we'll need new CSS to leverage the columns class. Need help on that last bit -- is the patch by Ian still good?

#7 @nacin
10 years ago

(In [16865]) use_default_gallery_style boolean filter and new gallery-columns-* class. see #15103.

#8 @nacin
10 years ago

(In [16866]) Deprecate twentyten_remove_gallery_css in favor of the use_default_gallery_style filter. see #15103.

Not bothering with _deprecated_function() there by design. Also not bothering making this entirely back compat: The chances that someone is deliberately using the default gallery styles in a child theme by removing this filter, is pretty much nil.

Remaining: columns styling.

#9 in reply to: ↑ 6 @lancewillett
10 years ago

Need help on that last bit -- is the patch by Ian still good?

Adding refreshed patch for just CSS rules.

10 years ago

Refreshed patch with only the CSS rules

#10 @lancewillett
10 years ago

  • Cc lance@… removed

#11 @lancewillett
10 years ago

  • Cc lance@… added

#12 @nacin
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16869]) Utilize gallery-columns-# classes in Twenty Ten. props ianstewart, lancewillett. fixes #15103.

#13 @hakre
10 years ago

Related: #10734

Note: See TracTickets for help on using tickets.