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'm trying to use Justin Tadlocks function for category specific custom post templates, but have become stuck when trying with a custom taxonomy, as his examples only have normal categories.

Can this be edited to work with custom tax's?

Thanks for any help :)

share|improve this question

I think what you're looking for is the Wordpress Template Hierarchy. Basically you can just name the template single-{custom-post-slug}.php and put it in the right directory.


Now that I understand what you're actually asking: I bet you could hook {$type}_template, which is called by get_query_template(). It's expecting a path to the template which has been loaded. You can filter based on get_queried_object() so that the correct template is used in the correct place. It's probably gonna take a bit of tinkering and a lot of print_r()ing on your part, but I think it's doable.

share|improve this answer
Unfortunately not :(. I know about single-{custom-post-slug}.php but i need a single post template based on custom tax, as two single pages (child/parent) of the same custom post are sharing their single.php, so need to make them individual another way. – Jezthomp Feb 21 '12 at 6:51
Updated my answer...see if that fits the bill a bit better – mor7ifer Feb 21 '12 at 11:28
Thanks a give that a look :) – Jezthomp Feb 21 '12 at 14:50

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.