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

Check if post type matches the slug.

if( get_post_type() == 'recipes' ){
   echo 'This is a recipe post!';
}
copy
Full Wordpress cheatsheet
Sitemap Git repository