【发布时间】:2020-10-02 14:48:58
【问题描述】:
我想用这个sn-p来替换产品的标题。这行得通。
/** Remove the shop loop title link and replace with brand **/
remove_action( 'woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title', 10 );
add_action('woocommerce_shop_loop_item_title', 'abChangeProductsTitle', 10 );
function abChangeProductsTitle() { ?>
<p class="name product-title custom-brand" style="height: 23px;">
<?php echo strip_tags ( get_the_term_list( $post->ID, 'product_brand', '', ', ', '' ) ); ?>
</p><?php
}
但我想弄清楚如果产品类型不是捆绑产品(来自https://woocommerce.com/products/product-bundles/),如何只运行这个sn-p(替换所有其他产品上的标题)。
有人可以帮帮我吗?
【问题讨论】:
标签: php wordpress woocommerce product woocommerce-product-bundles