Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
3 moving solution to answer
source | link

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?

EDIT: 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 (STYLESHEETPATH . '/product_taxonomy.php');
        exit;   
    }
}

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?

EDIT: 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 (STYLESHEETPATH . '/product_taxonomy.php');
        exit;   
    }
}

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?

2 added 384 characters in body
source | link

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?

EDIT: 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 (STYLESHEETPATH . '/product_taxonomy.php');
        exit;   
    }
}

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?

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?

EDIT: 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 (STYLESHEETPATH . '/product_taxonomy.php');
        exit;   
    }
}
1
source | link

Taxonomy template for all taxonomies attached to certain post type

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?