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');
} ?>
這將引發此錯誤:語法錯誤,意外 '{'