Conditional Tags: How to Run a Different JS Script for Different Pages
-
I want to run a different external JavaScript file for each WordPress page, depending on the page ID.
If Page ID is [1], run somescript.js
if Page ID is [15], run someotherscript.js
if Page ID is [195], run yetanotherscript.js
in all other cases, by default, run defaultscript.jsI assume, this has to be coded inside functions.php file – but I may be wrong.
Could someone please show me how this is done in WordPress with Conditional Tags?
Best regards,
Dimitri Vorontzov
- The topic ‘Conditional Tags: How to Run a Different JS Script for Different Pages’ is closed to new replies.