WordPress Lightbox and AJAX Loading

Product:

WonderPlugin Lightbox

Question:

I’m using my site a plugin that allows me to query the database and show results without requiring to code… I can also filter results based on search queries…

I’m using the lightbox in one page that uses such a filter/query. When I set my plugin to reload the entire page, it works fine (though pretty slow since there’s a lot of data), but if I filter using AJAX (i.e. the results are filtered without reloading the page), then the click event on the links that trigger the lightbox are removed… Therefore, after the first search/filter, the images are not clickable anymore…

Is there a way to prevent this (the click event from being removed)?

Answer:

After you use AJAx adding the data, you can call the following JavaScript to re-init the Lightbox:

jQuery(".wplightbox").wonderpluginlightbox();

Update:

If the issue is caused by Ajax loading of the WordPress theme, please view the following tutorial: WordPress lightbox and Ajax loading WordPress themes