2017-03-11 189 views
0

這已被問及之前,我已經嘗試了這裏的衆多解決方案,但沒有人爲我工作。我已使用woocommerce店面主頁模板將首頁設置爲靜態頁面,並且希望刪除頁面標題標題。我曾嘗試將此代碼添加到我的functions.php,但什麼也沒做,從woocommerce店面主題主頁刪除頁面標題

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'); 

任何人都可以幫助我做到這一點,而無需使用插件。謝謝!

回答

0

試試這個

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

嘗試下面的代碼隱藏在首頁上或從任何特定網頁的頁面標題

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'); 
相關問題