Load Custom Script On Any Archive Page Type

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.

  1. 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.
  2. 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 :

  1. # 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.
  2. # Swap out the json code with your own custom .json code.

Method 2

There’s 2 steps :

  1. # 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.
  2. # Install ACF – Advanced Custom Fields ( Free or Premium version ) and import the file named acf-110880.json.

Download Folder

Hooks Which Execute Within The Body Tags

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.