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:
parent
1a3fb85345
commit
78c85d5222
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user