查看content-single-product.php
在woocommerce github,我看到产品摘录应该是在价格之后
/**
* Hook: woocommerce_single_product_summary.
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
* @hooked WC_Structured_Data::generate_product_data() - 60
*/
do_action( \'woocommerce_single_product_summary\' );
所以要么你的主题是删除这个动作,要么你没有使用摘录。
如果您没有使用摘录,也看不到产品的主题,可以在下面激活它screen options
选项卡(如果系统语言为LTR,则位于右上角)。
如果你有摘录,但没有看到它,你将需要连接到woocommerce_single_product_summary
优先级在11到29之间(如果其他行动与优先级20挂钩,甚至可能在11到19之间)
例如
add_action(\'woocommerce_single_product_summary\', \'bt_custom_product_description\', 15);
function bt_custom_product_description () {
echo \'Some description here\';
}