• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

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

Register for full access

Related Tutorials

  • 32 Code Snippets To Remove or Modify All Schema Microdata in Genesis

Custom Fields Taxonomy Terms

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags