mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
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:
parent
7971f0a536
commit
65d22bd47c
@ -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