Documentation › Advanced: Apply Scripts to certain pages

Advanced: Apply Scripts to certain pages

Headway makes it easy for you to add scripts to your WordPress site with the ability to add scripts to the Header and/or Footer. This option is found in the WordPress » Headway » Options » Scripts/Analyticsconditonal-scripts

What seems to be a little known fact is those boxes also parse PHP. Convenient, we know! A limitation is that if you place scripts or code in those boxes, those scripts or code get added to every page/post/archive you have.

Applying a script to one page

Aha. You may think that you have to install a new plugin to do this. Of course, you don’t. All we have to do is make use of WordPress’s already existing conditional tags.

So for example, if you wanted to apply something only on your Portfolio page, you could do something like this:

The is_page conditional tag checks to see if a page is being displayed. You can then fill in the parameters to select one page or multiple pages. For more on is_page, please see the WordPress Codex

Copyright © 2016 Vesped Inc. All Rights Reserved. Proudly Powered by Headway and WordPress