is_shop, is_home, is_front_page doesn’t work for woocommerce

Question

I tried to remove breadcrumbs from homepage because it looks really ugly, but i can’t do this because conditionals don’t work.
*I took that from woocommerce docs

add_action( 'init', 'wcc_remove_woo_wc_breadcrumbs' );
function wcc_remove_woo_wc_breadcrumbs() {
    if ( is_home() || is_shop() || is_front_page() ) {
        remove_action( 'woo_main_before', 'woo_display_breadcrumbs', 10 );
    }
}

Line

 remove_action( 'woo_main_before', 'woo_display_breadcrumbs', 10 );

works correct, but unfortunatelly conditional tags don’t. Do you have any ida on woocommerce shop page as homepage?

0
, Kama 2 years 2019-12-30T08:38:51-05:00 0 Answers 104 views 0

Leave an answer

Browse
Browse