My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 122: Extra empty div from gallery shortcode
1 person starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  swallick
Type-Defect
Priority-High
Milestone-Release1.7


Sign in to add a comment
 
Reported by siboster, Jul 26, 2008
What steps will reproduce the problem?
1. Whenever I have [gallery] in a post
2.
3.

What is the expected output? What do you see instead?
There is an extra <div class="gallery"></div> at the end of my galleries.
Visually, this corresponds to a lot of whitespace below my galleries.

What version of the product are you using? On what operating system?
Wordpress 2.6, Sandbox 1.6

Please provide any additional information below.
This can be easily fixed by adding an extra if statement to sandbox's
gallery shortcode function...
 
Comment 1 by swallick, Jul 30, 2008
Yes, I see what you're describing. I'll grab this in the next release. Thanks for the
heads up.
Status: Accepted
Owner: swallick
Labels: Milestone-Release1.6.1
Comment 2 by joshix, Aug 31, 2008
The comments indicate there is already a fix that's not visible in svn yet, but just
in case it's useful, I eradicated this extra empty div by adding to the existing
conditional a check that we're not on the last image of the gallery:

--- a/functions.php	2008-06-28 01:07:28.000000000 -0700
+++ b/functions.php	2008-08-31 20:14:46.000000000 -0700
@@ -346,7 +346,7 @@
 		}
 
 		$output .= "\n\t" . '</' . $itemtag . '>';
-		if ( $columns > 0 && ++$i % $columns == 0 )
+		if ( $columns > 0 && ++$i % $columns == 0 && $i != count($attachments) )
 			$output .= "\n</div>\n" . '<div class="gallery">';
 	}
 	$output .= "\n</div>\n";



Comment 3 by swallick, Nov 04, 2008
(No comment was entered for this change.)
Labels: -Milestone-Release1.6.1 Milestone-Release1.7
Comment 4 by swallick, Nov 04, 2008
(No comment was entered for this change.)
Labels: -Priority-Medium Priority-High
Comment 5 by mmboylston, May 28, 2009
Has this project been abandoned?
Sign in to add a comment

Hosted by Google Code