is_shop, is_home, is_front_page doesn't work for woocommerce

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?

Topic woocommerce-offtopic breadcrumb Wordpress

Category Web


For is_front_page() and is_home() condition:

Important: Please note that these functions work only once WordPress is loaded such as on template files or specific action hooks. You can’t just dump these conditionals into functions.php and expect them to work.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.