Single Column Gallery in WordPress

You may (or may not) have noticed that in WordPress if you want to insert an image gallery into your post it does not give you the option of insert a gallery only 1 column wide.

This seems like an oversight. I have seen loads of photo and inspiration blogs around that often include multiple images in a single column so it would seem that being able to easily insert a single column gallery would be a useful feature.

Fortunately it is possible to insert a gallery one column wide, just not through the popup media window. Here’s how…

How to insert a single column gallery

It’s just a simple shortcode:

[gallery columns="1"]

Unfortunately in the Visual editor, when you go back to edit your post the gallery shortcode will be displayed as a gallery preview. If you click the gallery edit button (top left) then the media window will pop up but the columns menu will default to 3 as there is no value of 1.

So, what’s the fix?

It’s a change to WordPress core code but it’s really simple. Just edit wp-admin/includes/media.php and around line 1818 insert an select menu option with a value of 1.

1817
1818
1819
1820
1821
<select id="columns" name="columns">
	<option value="1">1</option>
	<option value="2">2</option>
	<option selected="selected" value="3">3</option>
	<option value="4">4</option>

I’ve submitted a WordPress patch here. If you would like this change to be made to WordPress please add your support to the Trac ticket.

usavpscompany.com
loosing weight
 

Ben Huson