Php 显示电子商务标签
如何使用WooCommerce 2.1.8版在单一产品页面的底部显示相关的标签,而不是相关的类别?我会在单一产品挂钩之后使用WooCommerce。然后使用get_the_tags() 主题的functions.php中有类似的内容:Php 显示电子商务标签,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,如何使用WooCommerce 2.1.8版在单一产品页面的底部显示相关的标签,而不是相关的类别?我会在单一产品挂钩之后使用WooCommerce。然后使用get_the_tags() 主题的functions.php中有类似的内容: add_action('woocommerce_after_single_product', 'add_tags_to_product'); function add_tags_to_product() { $posttags = get_the_tags()
add_action('woocommerce_after_single_product', 'add_tags_to_product');
function add_tags_to_product() {
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
echo $tag->name . ' ';
}
}
}