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.

For instance, I have a product post type and I would like all the taxonomies associated w/ this type, such as size, color, material etc to display using the same template without having to 1. create a catch all taxonomy.php that might interfere w/ taxonomies on other post types and 2. without having to manually create taxonomy-size.php, taxonomy-color.php, etc since new taxonomies can be created at any time.

can i do this by hijacking template redirect?

share|improve this question
    
Please move your solution to an answer so this doesn't haunt site as unanswered. –  Rarst Nov 10 '11 at 12:02
    
done. trying to go back and solve my unanswereds.... –  helgatheviking Feb 17 '12 at 19:39

1 Answer 1

up vote 0 down vote accepted

the answer is yes, yes i can. do love it when i find the answer w/in minutes of posting here.

add_action('template_redirect', 'my_template');

function my_template() {
    if ( is_tax() && in_array(get_query_var('taxonomy'), get_object_taxonomies('product') ) ){
        include (get_stylesheet_directory(). '/product_taxonomy.php');
        exit;   
    }
}
share|improve this answer

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.