1) 打开您的templates/content-product_cat.php
文件
2) 找到以下代码:
<li <?php wc_product_cat_class(); ?>>
<?php do_action( \'woocommerce_before_subcategory\', $category ); ?>
<a href="<?php echo get_term_link( $category->slug, \'product_cat\' ); ?>">
3) 更换管路
<a href="<?php echo get_term_link( $category->slug, \'product_cat\' ); ?>">
对于以下代码:
<?php if ($category->name == "adults1" || $category->name == "adults2") { ?>
<a onclick="return confirm(\'The content you are about to view are of a mature matter. Please be advised that the content may not be suitable for those under the age of 18\')" href="<?php echo get_term_link( $category->slug, \'product_cat\' ); ?>">
<?php } else { ?>
<a href="<?php echo get_term_link( $category->slug, \'product_cat\' ); ?>">
<?php } ?>
4) 代替
"adults1"
和
"adults2"
要控制的两个类别的名称。
希望它能解决你的问题。