Adding code to a post under a custom post type June 10, 2022 by Tarik Billa You can mix two functions: if( is_singular( $post_type ) && is_single( $post_slug ) ): // Insert analytics code; endif;