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

I know I can use single-{posttype}.php but can I use something like single-{custom-post-type-slug}.php to target a specific custom post type post? Or is there another way like a custom template which I can select from the admin? It doesn't seem to work on custom post type edit sreen.

share|improve this question

Please refer to the Template Hierarchy.

Custom Post Types use two different template files, depending on context.

For custom post type single post display:

  • single-{posttype}.php
  • single.php
  • index.php

For custom post type archive display:

  • archive-{posttype}.php
  • archive.php
  • index.php

In both cases, {posttype} is the custom post type $slug, as-defined in the register_post_type( $slug, $args ) call.

share|improve this answer
This does not answer the question, sorry. I want to target specific cpt post, not the generic cpt template. – Rade Oct 2 '13 at 13:51
Then you need to re-word your question to clarify exactly what you're after. single-{custom-post-type-slug}.php is quite unclear. Perhaps you mean single-{CPT-post-slug}.php? – Chip Bennett Oct 2 '13 at 14:00

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.