[英]remove breadcrumbs from checkout page storefront theme woocommerce
我試圖從帶有店面主題的 woocommerce 上的“結帳”頁面中刪除面包屑。 我在這里和其他地方看過了很多方法,但似乎都沒有。 任何建議,將不勝感激。
這是我嘗試過的幾個不同的代碼。 我哪里錯了?
add_action( 'init', 'wc_remove_storefront_breadcrumbs');
function wc_remove_storefront_breadcrumbs() {
if (is_page('checkout')){
remove_action( 'storefront_before_content', 'woocommerce_breadcrumb', 10 );
}
}
add_action( 'init', 'wc_remove_storefront_breadcrumbs');
function wc_remove_storefront_breadcrumbs() {
if (is_checkout()){
remove_action( 'storefront_before_content', 'woocommerce_breadcrumb', 10 );
}
}
嘗試以下操作,因為 'init' 可能是在那里使用的錯誤鈎子:
add_action( 'storefront_before_content', 'bbloomer_remove_storefront_breadcrumbs_checkout', 1 );
function bbloomer_remove_storefront_breadcrumbs_checkout() {
if ( is_checkout() ) {
remove_action( 'storefront_before_content', 'woocommerce_breadcrumb', 10 );
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.