How to call different template for different category archive page in woocommerce


I have two categories in woocommerce One is "Men" and Other is "Women".

Be default woocommerce call archive-product.php for category archive page.

But I want to show different layout for each category archive page.

How to do this?


You can see how WooCommerce is filtering <a href="https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-template-loader.php#L46-61" rel="nofollow">template_include</a> and will automatically look for taxonomy templates in the following order




So in your example I believe you would create the following templates:





Just answered this here: <a href="https://stackoverflow.com/questions/16353899/changes-on-archive-product-php-doesnt-work/38167759#38167759" rel="nofollow">changes-on-archive-product-php-doesnt-work</a>

you need to edit the file "taxonomy-product_cat.php" and add a conditional is_product_category( 'mycategory' ).

<ol><li>open your theme folder and add a new subfolder named "woocommerce" to it.</li> <li>copy the files "archive-product.php" and "taxonomy-product_cat.php" from /plugins/woocommerce/templates to the woocommerce subfolder in your theme.</li> <li>rename "archive-product.php" to "archive-mycategory.php" (or whatever you like, this will be the template file to the category).</li> <li>

open "taxonomy-product_cat.php" and wrap the wc_get_template( 'archive-product.php' ); with:

if (is_product_category( 'mycategory' )){ wc_get_template( 'archive-mycategory.php' ); } else { wc_get_template( 'archive-product.php' ); }

</li> </ol>


You should create different templates for different categories and then use them.

Have a look at here - <a href="https://wordpress.stackexchange.com/questions/95386/woocommerce-specific-template-for-product-category" rel="nofollow">https://wordpress.stackexchange.com/questions/95386/woocommerce-specific-template-for-product-category</a>


  • Problems running node.js in browser
  • Building/deploying a EJB .jar with its dependencies
  • Does Python have a linspace function in its std lib?
  • Haskell Time Limit on Evaluation
  • Updating multiple columns with data from subquery in MySQL
  • Intermittent “500 Server Error” on “/_ah/openid_verify” using AppEngine Federated / OpenID login
  • RSSI from Bluetooth Low Energy (BLE) Tags?
  • Can spring annotation access method parameters?
  • Start a JobIntentService Implicitly
  • Associating notes with different entities in a database
  • Move a ant dir project after the ant or subant task completes
  • How can I upload files to firebase's cloud storage with a path using the admin sdk?
  • Error when trying to upload Xcode project: Please update Xcode and rebuild your app
  • How to read a pdf file stored in sdcard using adobe reader installed in the android device?
  • How can I do TDD and Unit Testing for EF Code First entity declaration and mapping?
  • OpenGL es 1.1 - android - does gl.glDeleteTextures free video memory?
  • ZF2 InputFilter not validating fieldset
  • Posting an image using a jQuery AJAX call to an MVC action
  • list of nullable bool values is always nulls
  • How to update listview automatically after adding a new item into DB
  • Trouble using DataGridViewComboboxColumn for input
  • how to refresh alertdialog in flutter
  • Linux file permissions(in-depth) - numeric to string notation, and vice versa; additional file-permi
  • remove question mark from 301 redirect using htaccess when the user enters the old URL
  • Passing data between Fragments in View Pager
  • Draggable/Droppable for Battleship game
  • Oracle + Oci8 + php5.6 + Ubuntu 16.04
  • Update value of list item on button click in Angular 2
  • How can i share memory between parent-child process that free the memory automatically when they die
  • node.js eventEmitter : Listen for events across files
  • Stop the background service after particular time in android
  • Sending in an object of type Object instead of String - Polymorphism
  • JQuery and PHP validation problem?
  • Issue with Terrain Collision using Three.js
  • JQuery Mobile Ajax Navigation in Single-Page Template
  • Rotating Towards Path in OpenGL