So I was asked to add some analytics code to a sponsored post. I usually do it like this:
if(is_single('post_slug')): // Insert analytics code; endif;
However, I cannot figure out how to do it on a post with a custom post type.
I found this function which takes the slug of the custom post type:
My question is, is there a function that would take the custom post type and the slug of the post?
Would really appreciate your help. Thanks!