Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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.

Update

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
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 –  m0r7if3r Feb 21 '12 at 11:28
    
Thanks a give that a look :) –  Jezthomp Feb 21 '12 at 14:50
add comment

Your Answer

 
discard

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.