0

Generally, this is the hierarchal order in which templates will work for the custom post type.

  1. single-{post-type}-{slug}.php – (Since 4.4) First, WordPress looks for a template for the specific post. For example, if post type is product and the post slug is dmc-12, WordPress would look for single-product-dmc-12.php.

  2. single-{post-type}.php – If the post type is product, WordPress would look for single-product.php.

  3. single.php – WordPress then falls back to single.php.

  4. singular.php – Then it falls back to singular.php.

  5. index.php – Finally, as mentioned above, WordPress ultimately falls back to index.php.

I have created this template:

single-theme.php

But the posts pages of the theme CPT are not picking up this template? what could be the issue?

If needed I can update my question with the full CPT function.

I am using this in CPT can this be a culprit:

'capability_type'       => 'page',

?

1 Answer 1

4

You registered the post type with the name 'theme'?

Also when changing templates and anything that has any correlation to url-s always reload or load the page admin->settings->permalinks. Sometimes without this, the changes won't take effect.

2
  • Yes, with the name "theme"
    – WordCent
    Jan 4, 2018 at 12:46
  • Hmm! The way you suggested me I did, and it worked. Looks like it was a non-issue. what causes this? Is this some cache settings? I am accepting your answer hopefully it will help someone else
    – WordCent
    Jan 4, 2018 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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