我想在产品页面上的简短描述后显示HTML文本,但仅在特定类别(categories)中的特定产品上显示。
我想我必须使用in\\u类别,但我不知道如何在简短描述之后显示文本。
我的首选是使用函数/过滤器/操作。
此代码适用于:
function filter_woocommerce_short_description( $post_excerpt ) {
$your_msg=\'Test\';
return $post_excerpt.\'<br>\'.$your_msg;
};
add_filter( \'woocommerce_short_description\',\'filter_woocommerce_short_description\',10, 1 );
但这一条适用于所有产品页面。。