Template Files for Product Category and Product Tag Pages

Product categories is a custom taxonomy product_cat, product tags is a custom taxonomy product_tag, right? So, according to the template hierarchy in WordPress Codex, the files should be taxonomy-product_cat.php, archive.php etc?

Surprise, but no! 😁

And that’s why I decided to publish a post about it, because it is kind of unclear. It is even more unclear than with the shop page we discussed in the previous tutorial.

Look at the diagram:

Template hierarchy for WooCommerce product categories and tags

I think the main reason why WooCommerce uses this template structure for product categories and tags is because the content of these pages is auto-generated by the plugin. It makes it impossible to use native taxonomy and archive templates for this purpose.

Related

Misha Rudrastyh

Misha Rudrastyh

I develop websites since 2008, so it is total of 13 years of experience, oh my gosh. Most of all I love love love to create websites with WordPress and Gutenberg, some ideas and thoughts I share throughout my blog.

Need some developer help? Contact me