WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We know you can do if ( is_singular( 'my-cpt' ) ) to test for a specific custom post type, but what about doing one thing if the post is a built-in post type, and another if it is not?

Is it enough to just test against if ( is_singular() && ! is_singular( 'post' ) )? Or are there some implications or subtleties that are escaping me at the moment?

share|improve this question
up vote 1 down vote accepted

I don't know of a conditional tag, but here's how you would list the built-in types:

echo implode(',', get_post_types( array('_builtin' => true ) ) );



Maybe better:

// 1 result if it exists and is builtin, 0 otherwise
get_post_types( array('_builtin' => true, 'name' => $post_type ) );
share|improve this answer
That's a great angle! – Tom Auger Oct 3 '11 at 16:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.