0
我试图为woocommerce类别使用自定义模板,但无法获得有条件工作,我在这里错过了什么吗?我试着去改变条件标签不工作,为什么?
<?php woocommerce_get_template_part('content', 'single-product-cans'); ?>
要这样:
<?php if (is_product_category('cans') {
woocommerce_get_template_part('content', 'single-product-cans');
}else{
woocommerce_get_template_part('content', 'single-product');
} ?>
这将引发此错误:语法错误,意外 '{'