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

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
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');
share|improve this answer

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.