1

I'm using woocommerce for a wordpress site, I need to create different templates for different categories. I followed this answer, but it doesn't work for me https://stackoverflow.com/a/24928010/3774595.

I create a new file "taxonomy-product_cat-66.php", where 66 is the ID of my category, but It doesn't work. Is there a way to make it works?

Community
  • 1
  • 1
B_etta
  • 117
  • 2
  • 17
  • Please post your code for the new template. It's [difficult to provide constructive feedback without having more information about what you tried](http://stackoverflow.com/help/how-to-ask). Also, you might want to [ask this question on the Wordpress StackExchange site](http://wordpress.stackexchange.com/). – morphatic Jul 15 '15 at 15:49
  • Did you check this tutorial? https://support.woothemes.com/hc/en-us/articles/203106637-Creating-custom-category-templates – kat_indo Jul 15 '15 at 17:24

1 Answers1

3

You can see how WooCommerce is filtering template_include and will automatically look for taxonomy templates in the following order

taxonomy-YOUR_TAXONOMY-YOUR_TERM.php

then

taxonomy-YOUR_TAXONOMY.php

Therefore you cannot use the Term ID, but rather should use the term slug. So for example men's and women's category archives would require the following templates:

taxonomy-product_cat-men.php

and

taxonomy-product_cat-women.php

helgatheviking
  • 25,596
  • 11
  • 95
  • 152