Make JS run on every page, not just specific template (2 posts)

  1. martijnboersma
    Posted 3 years ago #

    I have 'ajaxed' my site, and as a result, JS which is supposed to run on a certain page template does not work properly anymore. For example, when I load my site and navigate to FAQs, the Q&A's don't to their harmonica thing.

    My guess is that I will need to edit my theme so that your (FAQ's) JS runs on every page. I have tried editing functions.php and removing the 'if statement' before the JS section that relates to FAQ's. Unfortunately, this didn't do the trick.

    Any pointers would be much appreciated!
    Thanks a lot for your time :-)

  2. Carlos Moreira
    Posted 3 years ago #


    Check out this WP function:


    Follow some of the examples.

    You'll probably be able to include the JS in every page, adding some code to your functions.php

    Hope it helps!

Topic Closed

This topic has been closed to new replies.

About this Topic