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

git-svn-id: https://develop.svn.wordpress.org/trunk@7516 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-26 03:34:55 +00:00
parent 1a3fb85345
commit 78c85d5222
1 changed files with 2 additions and 1 deletions

View File

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