Title: Adding script in custom post type archive page
Last modified: January 5, 2020

---

# Adding script in custom post type archive page

 *  Resolved [odi92](https://wordpress.org/support/users/odi92/)
 * (@odi92)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/adding-script-in-custom-post-type-archive-page/)
 * Hi,
 * I want to add a script to a CPT archive page. As it’s a page I can just edit 
   with wordpress I’m wondering what’s the best way to achieve that.
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [SOGO](https://wordpress.org/support/users/orenhav/)
 * (@orenhav)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/adding-script-in-custom-post-type-archive-page/#post-12295487)
 * you can add the script to the general settings and in the JS you should check
   if the body has a class archive-<your CPT> class then the script should run

Viewing 1 replies (of 1 total)

The topic ‘Adding script in custom post type archive page’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/oh-add-script-header-footer_d6d6d6.
   svg)
 * [SOGO Add Script to Individual Pages Header Footer](https://wordpress.org/plugins/oh-add-script-header-footer/)
 * [Support Threads](https://wordpress.org/support/plugin/oh-add-script-header-footer/)
 * [Active Topics](https://wordpress.org/support/plugin/oh-add-script-header-footer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/oh-add-script-header-footer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/oh-add-script-header-footer/reviews/)

## Tags

 * [cpt](https://wordpress.org/support/topic-tag/cpt/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * 1 reply
 * 2 participants
 * Last reply from: [SOGO](https://wordpress.org/support/users/orenhav/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/adding-script-in-custom-post-type-archive-page/#post-12295487)
 * Status: resolved