WooCommerce StoreFront child 主题 - 如何删除主页上的标题

WooCommerce StoreFront child theme - How to remove title on homepage

你知道有什么钩子或过滤器可以删除 StoreFront 主题首页上的标题吗?

我尝试了几种解决方案,但都没有用。我使用 Storefront(Woothemes 的 Stationery)的主题 child。

感谢您的帮助。

我用谷歌搜索了更多详细信息。请试试这个

if ( is_page('page id') )
{
      add_filter( 'the_title', '__return_false' );
}

尝试将此代码添加到 functions.php:

if ( is_front_page() ) {
   remove_action( 'storefront_page', 'storefront_page_header' );
}

这应该删除(包括)之间的所有内容:

<header class="entry-header">
    <?php
        storefront_post_thumbnail( 'full' );
        the_title( '<h1 class="entry-title">', '</h1>' );
    ?>
</header><!-- .entry-header -->

我尝试了这里和其他帖子中的所有示例,它在 运行 初始化挂钩中的 remove_action 之后起作用,如下所示:

function wc_hide_page_title() {
    remove_action( 'storefront_page', 'storefront_page_header' );
}
add_action( 'init', 'wc_hide_page_title');