S
S
Smeecy Smeecy2021-05-27 00:35:09
WordPress
Smeecy Smeecy, 2021-05-27 00:35:09

How to make sure that the template is also applied to the subcategory?

How can I change the code so that the archive-product-custom.php template works not only in the 'zakaznaya-produktsiya' category, but also in its subcategories?

<?php
  if ( has_term( 'zakaznaya-produktsiya' , 'product_cat' ) ) {
    wc_get_template( 'archive-product-custom.php' );
  }
  else { wc_get_template( 'archive-product.php' );
  }
 ?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question