1. Home
  2. Wordpress
  3. Check if post is custom type

Check if post type matches the slug.

#wordpress#php
if( get_post_type() == 'recipes' ){
   echo 'This is a recipe post!';
}
copy
Full Wordpress cheatsheet