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

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.