From 566563e701d8e86ddb4f0bf0cd39a987b5c17803 Mon Sep 17 00:00:00 2001 From: Leo Gono Date: Tue, 3 Mar 2015 15:26:50 +0800 Subject: [PATCH] change default columns to 3. Issue is if you set 3 in Gallery options it will output 4 columns in the frontend. The default WordPress column is 3 for gallery and if it's set to 3, it does not added any column attribute to the shortcode which cause the issue. Setting the default to 3 should fix the issue. --- lib/gallery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gallery.php b/lib/gallery.php index fc569083cd..b17fa62729 100644 --- a/lib/gallery.php +++ b/lib/gallery.php @@ -43,7 +43,7 @@ function gallery($attr) { 'itemtag' => '', 'icontag' => '', 'captiontag' => '', - 'columns' => 4, + 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', @@ -51,7 +51,7 @@ function gallery($attr) { ], $attr)); $id = intval($id); - $columns = (12 % $columns == 0) ? $columns: 4; + $columns = (12 % $columns == 0) ? $columns: 3; $grid = sprintf('col-sm-%1$s col-lg-%1$s', 12/$columns); if ($order === 'RAND') {