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?

  • Please move your solution to an answer so this doesn't haunt site as unanswered.
    – Rarst
    Commented Nov 10, 2011 at 12:02
  • done. trying to go back and solve my unanswereds.... Commented Feb 17, 2012 at 19:39

1 Answer 1


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');

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.