0

I've a CPT: Services and created two posts underneath it. Now, both those posts have some static content which is different in structure and design from each other. How do I place that content in my single-services.php so that it gets showed up for the appropriate posts?

I have a vague idea of putting the two posts under separate categories or create a custom taxonomy but don't know how do I proceed after that or is there a completely different and easier method to achieve this?

1 Answer 1

1

WordPress allows to do this rather neatly for pages, supporting page-$slug.php and page-$id.php templates in hierarchy. Unfortunately it doesn't apply to posts and Custom Post Types.

So your options are either handling this inside single-services.php (in one file, or by further including other template files) or adjusting hierarchy to use custom templates for your posts as needed.

1
  • I guess I'll change them to pages, put them under the category of 'services' and remove the CPT completely. Thanks!
    – nimsrules
    Commented Dec 24, 2014 at 9:02

Your Answer

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

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