This download folder contains 2 code snippets which enable you to load a script on any WordPress archive page type including category, tag, date, author and any other archive page type.
- The 1st method uses PHP code to print the script directly into your page using any WordPress or theme specific hook with any WordPress conditional tag for any category using the taxonomy slug.
- The 2nd method enables you to use a plugin like ACF to add your script and execute the script conditionally using PHP code.
Works in any WordPress theme with any script type including javascript, jQuery & .json scripts.
Installation Steps
Method 1
There’s 2 steps :
- # Copy & paste the PHP code from the file named functions-1.php to the end of your child themes functions file or custom functionality plugin.
- # Swap out the json code with your own custom .json code.
Method 2
There’s 2 steps :
- # Copy & paste the PHP code from the file named functions-2.php to the end of your child themes functions file or custom functionality plugin.
- # Install ACF – Advanced Custom Fields ( Free or Premium version ) and import the file named acf-110880.json.
Was This Tutorial Helpful?