有时我们不想显示WooCommerce Shop Page页面标题,如下图所示,需要如何操作呢?随ytkah一起来看看吧。在主题function.php文件中添加下面的代码就可以隐藏了
add_filter( 'woocommerce_show_page_title', 'bbloomer_hide_shop_page_title' );
function bbloomer_hide_shop_page_title( $title ) {
if ( is_shop() ) $title = false;
return $title;
}
如果想隐藏产品分类页的标题呢?同样道理
add_filter( 'woocommerce_show_page_title', 'bbloomer_hide_cat_page_title' );
function bbloomer_hide_cat_page_title( $title ) {
if ( is_product_category() ) $title = false;
return $title;
}
如果想隐藏shop、category、tag等页面的标题呢?
add_filter( 'woocommerce_show_page_title', '__return_null' );
参考资料https://businessbloomer.com/woocommerce-remove-shop-title-woocommerce-shop-page/
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有