I would like to determine if the user is on a custom post type. How can I achieve that?
Leave a Reply
You must be logged in to post a comment.
I would like to determine if the user is on a custom post type. How can I achieve that?
You must be logged in to post a comment.
How and where will you be using this?
To get the post type of a post in a the loop you can use
get_post_type()
To determine if a user is on a custom post type, like if you got multiple post types, you could check if it’s no ‘post’ or ‘page’, if you want to check for a certain post type you just enter the unique custom post type name.
If this is not the answer you are looking for, please give us more info on the problem.