【发布时间】:2017-08-01 14:47:22
【问题描述】:
以前有人问过这个问题,我在这里尝试了许多解决方案,但没有一个对我有用。我已使用 woocommerce 店面主页模板将主页设置为静态页面,并希望删除页面标题标题。我尝试将此代码添加到我的functions.php,但它什么也没做,
if ( is_front_page() ) {
remove_action( 'storefront_page', 'storefront_page_header' );
}
我已经尝试了以下答案:
How to hide page title from WooCommerce Storefront theme homepage?
&
WooCommerce StoreFront child theme - How to remove title on homepage
以下代码有效,但仅适用于商店页面。我找不到主页的条件标记。
function wc_hide_page_title()
{
if( !is_shop() ) // is_shop is the conditional tag
return true;
}
add_filter( 'woocommerce_show_page_title', 'wc_hide_page_title' );
任何人都可以在不使用插件的情况下帮助我做到这一点。谢谢!
【问题讨论】:
标签: php wordpress woocommerce