Handle more than 3 columns in gallery. Props Dickie. fixes #6382

git-svn-id: http://svn.automattic.com/wordpress/trunk@7516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-26 03:34:55 +00:00
parent 7971f0a536
commit 65d22bd47c
1 changed files with 2 additions and 1 deletions

View File

@ -368,6 +368,7 @@ function gallery_shortcode($attr) {
$itemtag = tag_escape($itemtag);
$captiontag = tag_escape($captiontag);
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$output = apply_filters('gallery_style', "
<style type='text/css'>
@ -378,7 +379,7 @@ function gallery_shortcode($attr) {
float: left;
margin-top: 10px;
text-align: center;
width: 33%; }
width: {$itemwidth}%; }
.gallery img {
border: 2px solid #cfcfcf;
}