I would like to determine if the user is on a custom post type. How can I achieve that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.