Question

I have a wordpress installation with some plugins and a custom theme. On one page Thickbox is used to display picture pop-ups.

The problem is that it only works for the first pictured clicked. Somehow when clicking the thickbox.js modifies the href of all other images which I want to display with thickbox and further clicks fail.

The problem appears on the following page: http://www.zaengerlein.de/shop

The original image URL for example is: http://www.zaengerlein.de/wp-content/uploads/produktbilder/3/tn/s-150-150-P1010053.JPG

Upon clicking an image, the URL changes to the following: http://www.zaengerlein.de/wp-content/uploads/produktbilder/3/tn/s-150-150-P1010053.JPG&width=640&height=666

Now of course when I click another image, thickbox will fail to load that picture.

Any help would me much appreciated :)

regards, Goeran

Was it helpful?

Solution

This issue is forced by https://www.zaengerlein.de:443/wp-admin/js/media-upload.js , it manipulates the href-attribute.

You may solve it by executing the function called inside this script on jQuery's ready-event only when tinymce is available:

replace this portion inside the script:

var tb_position;(function(a){

by this:

var tb_position;(function(a){if(typeof tinymce=='undefined'){return;}

This will fix the issue for guests(without tinymce loaded), but I can't tell you what happens when tinymce is loaded.

Of course a better approach would be to include the script only when needed(tinymce is available)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top