Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从woocommerce店面主题主页中删除页面标题_Php_Wordpress_Woocommerce - Fatal编程技术网

Php 从woocommerce店面主题主页中删除页面标题

Php 从woocommerce店面主题主页中删除页面标题,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,以前有人问过这个问题,我在这里尝试过许多解决方案,但没有一个对我有效。我已使用woocommerce店面主页模板将主页设置为静态页面,并希望删除页面标题标题。我曾尝试将此代码添加到functions.php中,但没有任何效果 if ( is_front_page() ) { remove_action( 'storefront_page', 'storefront_page_header' ); } 我尝试了以下答案: & 下面的代码有效,但仅适用于商店页面。我找不到主页的条件标记

以前有人问过这个问题,我在这里尝试过许多解决方案,但没有一个对我有效。我已使用woocommerce店面主页模板将主页设置为静态页面,并希望删除页面标题标题。我曾尝试将此代码添加到functions.php中,但没有任何效果

if ( is_front_page() ) {
   remove_action( 'storefront_page', 'storefront_page_header' );
}
我尝试了以下答案:

&

下面的代码有效,但仅适用于商店页面。我找不到主页的条件标记

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' );
有人能帮我做这件事而不用插件吗。谢谢

试试这个

function wc_hide_page_title() {
    if( is_front_page() ) 
        return true;
}
add_filter( 'woocommerce_show_page_title', 'wc_hide_page_title' );

尝试使用以下代码在主页或任何特定页面上隐藏页面标题

function wc_hide_page_title()
{
    if( !is_page('home') ) // is_page is the conditional tag. 'home' is the page slug or use ID of the page instead of page slug.
    return true;
}
add_filter( 'woocommerce_show_page_title', 'wc_hide_page_title' );

这在发布时起作用:

function jasom_dotnet_change_homepage_title( $args ) {
    if(is_front_page()) {
        remove_action( 'storefront_page', 'storefront_page_header', 10 );
    }
}
add_action( 'wp', 'jasom_dotnet_change_homepage_title' );

如果您使用的是店面主页模板,则需要使用店面主页操作

function wc_hide_page_title() {
    if( is_front_page() ) 
    remove_action( 'storefront_homepage', 'storefront_homepage_header', 10 );
}
add_action( 'woocommerce_show_page_title', 'wc_hide_page_title');