所有产品的Woocommerce产品默认描述

时间:2018-05-21 12:37:55

标签: wordpress woocommerce custom-wordpress-pages woocommerce-theming

是否可以为所有产品页面添加Woocommerce产品默认描述。那应该是图片或笔记文字。我希望它将放在描述文本的上方或下方。

提前致谢

1 个答案:

答案 0 :(得分:0)

你可以使用像

这样的钩子
// define the woocommerce_single_product_summary callback function
function my_custom_action() { 
    echo '<p>This is my custom action function</p>';
};     
add_action( 'woocommerce_single_product_summary', 'my_custom_action', 15 );

或 woocommerce_after_single_product_summary

// define the woocommerce_after_single_product_summary callback 
function action_woocommerce_after_single_product_summary( $evolve_woocommerce_after_single_product_summary, $int ) { 
    // make action magic happen here... 
}; 

// add the action 
add_action( 'woocommerce_after_single_product_summary', 'action_woocommerce_after_single_product_summary', 10, 2 );  

或woocommerce_before_single_product_summary

// define the woocommerce_before_single_product_summary callback 
function action_woocommerce_before_single_product_summary( $woocommerce_show_product_sale_flash, $int ) { 
    // make action magic happen here... 
}; 

// add the action 
add_action( 'woocommerce_before_single_product_summary', 'action_woocommerce_before_single_product_summary', 10, 2 );

或者您也可以直接更改woo-commerce文件。

相关问题