Load scripts based on post type
If you hook onto a later action such as template_redirect, you should be able to check the query vars to determine if your specific post type is being viewed. add_action( ‘template_redirect’, ‘example_callback’ ); function example_callback() { if( is_single() && get_query_var(‘your-posttype’) ) wp_enqueue_script( .. your args .. ); } Or alternatively like this… add_action( ‘template_redirect’, ‘example_callback’ … Read more