Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question