Display different custom fields for different categories in WooCommerce
问题 I am trying to display different custom fields for different categories in WooCommerce. I have used the following conditional statement in content-single-product.php template file: if(is_product_category('categoryname')) { // display my customized field } else { do_action( 'woocommerce_after_single_product_summary' ); } But this isn't working for me. Is there any better way to rectify this issue? Thanks. 回答1: The condition is_product_category() will not work for you in single product