How To Modify Archive Templates in WooCommerce

If you want to modify the default product archive page template for a specific taxonomy or term like category, you can use code to load a custom template conditionally in 3 steps :

Step 1 : Copy and paste this PHP code from the view raw link to the end of your child themes functions file or custom functions/code snippets plugin.

Step 2 : Copy over your WooCommerce archive-product.php template to your child themes and rename it to match the filename in the code. In this case, custom-archive.php.

Step 3 : In the code, set your conditional tag so your new custom-archive.php template only loads on the taxonomy archives you want, in this case, the shoes category archive page on this line :

if ( is_product_category('shoes') ) {

For use on multiple archives, add an array to the conditional tag like this :

if ( is_product_category(array('shoes', 'electronics') ) ) {

This will load the custom-archive.php template on both category archive pages.

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.