How do I add the lightbox script to a file other than footer.php?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Acknowledged
Is there a way to add the lightbox script to a different file than footer.php? The lightbox is not working on my wordpress website and I think it is because my footer file does not contain this code <?php wp_footer();?>.
Has anyone inserted the script on a different file with success? Or suggestions on how to make it work on a website without the <?php wp_footer();?> code?
Photo of Patrick K

Patrick K

  • 2 Posts
  • 0 Reply Likes

Posted 1 year ago

  • 0
  • 1
Photo of Heather Sturm

Heather Sturm, Integrations Support Specialist

  • 99 Posts
  • 3 Reply Likes
Hi Patrick! Thanks for reaching out!

I took a look at your Lightbox form and the site on which it is set to appear. One thing I noticed is that the form is coded into the page in 2 locations - lines 14 and 882.

Before I dig in to troubleshoot further, I'd recommend removing the code on line 14 and making sure that the Lightbox code only appears once on the page. This should be just before the last closing body tag, which looks like where you've got it on line 882.

Try that first, and let me know if you are still unable to get the form to work. I'd be happy to dig in a bit further if needed!

Cheers,
Heather
Photo of Patrick K

Patrick K

  • 2 Posts
  • 0 Reply Likes
Thank you for responding and pointing that out. I can't believe I didn't notice that the script was on the page twice. I made the change and the lightbox isn't locking up the page anymore. I still need to work out some other bugs but thank you very much for your help.