Lightbox and Fancybox plugins not working on WordPress site – solved

I’ve installed the Lightbox plugin on a few site without a problem but when I added it recently to a client’s site it did nothing. No errors appear, but when clicking on an image it just opened that image by itself not in a pop-up lightbox.

I uninstalled and reinstalled. Nothing. Tried fancybox instead. Nothing.

Finally I opened the page with the image on it and viewed the source. With this pasted into my html editor I could tweak the page and by trial and error found the problem was a datepicker JavaScript loaded by the Custom Contact Form plugin. With this removed the lightbox plugin worked perfectly.

Fortunately the solution is simple: On the Custom Contact Form settings page, just change the option to only load the Javascript on forms pages to ‘Yes’. As long as you don’t want a lightbox image on the same page as a contact form then this will work fine.

Custom Contact Form settings restrict JS to form pages only

Otherwise you can also (or instead of) disable the use of Jquery for Custom Contact Forms.

disable front end jquery

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.