Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have 3 galleries on a single page. All three are wrapped by jQuery Cycle to create 3 simple rotators that each have a thumbnail pager. Each gallery is using the [gallery] shortcode with a few options added in, and each has unique images. This is working as intended.

The issue is that each rotator has what I'd call a ghost image in the 4th spot. Basically an img tag with a src attribute that says "undefined" in the console.

I've tried deleting the images and adding them again with new ID's, but each time each rotator has a ghost image in the 4th spot. Anyone have any suggestions on this?

Upon further inspection in different browsers, it looks like there are actually ghost images in spots 4, 6, & 7. Each one says "undefined" in the image source. There actually shouldn't be any image there at all, not even a wrapping li should be there.

Here's a screenshot if that helps better understand what its doing. enter image description here

share|improve this question
If you turn off jQuery cycle so that your images are displayed normally, do the rogue images exist then, or not? –  vancoder Apr 2 '13 at 21:03
Yes, they still exist. I created a quick work-around, but in reality it only masks the issue rather than fixes it. jQuery('#gallery-1 br, #gallery-2 br, #gallery-3 br').remove(); jQuery("img[src='undefined']").parent("a").parent("li").remove(); –  AndyWarren Apr 2 '13 at 21:08
So this isn't a jQuery issue. Maybe you have broken/corrupt images in your gallery? –  vancoder Apr 2 '13 at 21:13
I don't have any actual galleries created in the WordPress backend. I'm only calling the images I want by their ID from the shortcode in the page template. There are no ghost IDs being called, I have checked that several times. Very bizarre to say the least. –  AndyWarren Apr 2 '13 at 21:14
Does the gallery shortcode not also (in addition to specified IDs) return all images attached to the post it's used in? In which case - any dodgy images attached to this post? –  vancoder Apr 2 '13 at 22:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.