The Case of the Duplicated Images

If you’ve been browsing this site lately, you might have noticed some oddness. Oh, OK. You might have noticed some more odd things than normal. Oh, alright, more odd things than normal for here.

In some posts with two or more pictures, like the recent Christmas tree one, the second image was appearing above the first, with a mangled caption, rather like this:



A closer view shows just how odd it was:

Even odder

Even odder

When I belatedly noticed this last night, I spent some time wondering what could be causing it. At first, I thought I’d done Something Weird in the affected posts, so I went back and edited one, removing the images, putting them back in, muttering a great deal as I went. But I was soon convinced that there was noting out of the ordinary in the posts, so it had to be some bit of code that affects how posts are displayed the the legions of regular readers[1]. Knowing that I have the coding skills of an intoxicated lemur[2], my first suspect was my EXIF displaying stuff. So, I disabled all that, and was pleasantly surprised to find it made no difference. While I still had a problem, it looked like it wasn’t my fault, which is much the best kind of problem to have.

I then tried switching to the default Twenty Twelve theme, in case one of the changes in my child theme were breaking it. And woo, hoo, etc, that didn’t make any difference either.

The next suspect was the Lightbox Plus plugin – that’s the thingy that makes the pictures zoom to full screen when you click on them. Sure enough, when I disabled it, the extra pictures went away. But that wasn’t a fix as such – I like having the zoomy pictures, so I needed another solution.

I did some fiddling on my test site[3] and found that there was a setting labelled Use WP Caption for LBP Caption that appeared to be the culprit. What this does is make sure that the zoomy picture window shows your carefully crafted caption for each image. Unfortunately, in my case, it was doing something a bit odd involving inserting an image tag and a few other bits into the caption, causing the messy duplication thingy.

Having checked for updates, and found that the plugin site shows it’s only listed as compatible up to WordPress 3.3.2, and the last version was released in January, I decided to look for another lightbox plugin.

There are a few of these in the WordPress plugin directory, so it was a matter of picking some recently updated ones and seeing how they worked. The first one looked OK, but stopped the nifty Jetpack Carousel feature working on my galleries, so that was no good for me. The next one I tried was Slenderbox, one of the newest releases. That appears to be working nicely without any obvious breakage.

Let me know if you do see any oddness. Other than the usual kind, that is.

[1] Or other such mythical beings
[2] Actually, I’ve no idea about how good lemurs are at coding while sober, never mind after a drink or three, but it seemed a suitable comparison
[3] Hint: if you’re in the habit of messing around with your site, get yourself another one which you can safely break. It’s much less traumatic than finding you’ve made your live site stop working…


3 thoughts on “The Case of the Duplicated Images

  1. Pingback: They took my title away! | Losing it

Comments are closed.