WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#21475 closed defect (bug) (fixed)

Twenty Twelve: Better Gallery Columns Support

Reported by: philiparthurmoore Owned by: lancewillett
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

By default WordPress allows users to set anywhere from 1 to 9 columns for their galleries. At present the margins between those images isn't consistent (see attachment). The following shortcode test was used in order to create the screenshot:

[gallery columns="1" size="large"]
[gallery columns="2" size="large"]
[gallery columns="3" size="large"]
[gallery columns="4" size="large"]
[gallery columns="5" size="large"]
[gallery columns="6" size="large"]
[gallery columns="7" size="large"]
[gallery columns="8" size="large"]
[gallery columns="9" size="large"]

Let's create better displays for those columns.

Attachments (3)

21475-padding-in-pixels.jpg (663.1 KB) - added by pdclark 7 years ago.
Current padding - value in pixels
21475-padding-in-percent.jpg (635.7 KB) - added by pdclark 7 years ago.
Recommended padding - in percent
21475.patch (597 bytes) - added by pdclark 7 years ago.
Set image width and padding as percentage in galleries

Download all attachments as: .zip

Change History (9)

#2 @pdclark
7 years ago

  • Owner set to pdclark
  • Status changed from new to reviewing

@pdclark
7 years ago

Current padding - value in pixels

@pdclark
7 years ago

Recommended padding - in percent

@pdclark
7 years ago

Set image width and padding as percentage in galleries

#3 @pdclark
7 years ago

  • Cc pdclark added
  • Keywords has-patch added
  • Owner changed from pdclark to philiparthurmoore

I added a patch that sets the width by percentage. While in there, I noticed that the image padding set in pixels caused the white space between the image and border to be disproportionately large for small images (many columns). I've attached screenshots, padding-in-pixels and padding-in-percent to show the difference. Patch sets both width and padding as percent.

#4 @lancewillett
7 years ago

  • Milestone changed from Awaiting Review to 3.5

#5 @lancewillett
7 years ago

  • Owner changed from philiparthurmoore to lancewillett
  • Status changed from reviewing to accepted

#6 @lancewillett
7 years ago

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

In [21478]:

Twenty Twelve: better gallery columns support, and CSS cleanup. Closes #21475, props philiparthurmoore and pdclark.

Note: See TracTickets for help on using tickets.