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 :)


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.

  • 1
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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