Can somone PLEASE tell me how to insert javascript correctly...

2 replies
  • WEB DESIGN
  • |
Hi Guys,

I'm looking for a simple explanation of how and where to insert my javascript code for a light box webform, so that it will load up only on the specific page I want on my WordPress site?


Thanks in advance!
#correctly #insert #javascript #somone #webforms #wordpress
  • Profile picture of the author webinsiders
    View the Wordpress page in html/code mode and paste the code at the top.

    If it's a light box and has to call a javascript library or such, put that code into the header wordpress template and then put the call to open up the light box into your page code
    {{ DiscussionBoard.errors[1958284].message }}
    • Profile picture of the author golusin
      Put conditional tag inside header.php file of your theme. Something like

      if (is_home()) { }
      if (is_single()) { }
      if (is_page()) { }
      if (is_page('YOUR_PAGE_ID')) { }
      if (is_page('YOUR_PAGE_SLUG')) { }

      ... etc.

      In that way you can only load JavaScript on page you want.
      {{ DiscussionBoard.errors[1959824].message }}

Trending Topics