1
我搜索了很多,我沒有找到任何具體到這個,或者至少,我的發展技能還不是很好,如果有人可以幫助我欣賞。Woocommerce特定的橫幅產品類別和子女
我的目標是顯示在作爲X類或同X.
例如子類別內的每個產品文本: 水果 -bananas
如果波紋管產品香蕉裏面也會顯示代碼,因爲屬於水果。
add_filter('woocommerce_short_description', 'single_product_short_description', 10, 1);
function single_product_short_description($post_excerpt){
if (is_product_category(array(140,20)))
$post_excerpt = $post_excerpt. '<br><div class="product-message"><p>' . __("Whats the measure? <a href='/#right-measure' target='_blank'>Check</a>.", "woocommerce") . '</p></div>';
return $post_excerpt;
}
我知道我的代碼是不好的,因爲每一次的客戶端添加一個子類我必須解決它......