Support » Plugin: WooCommerce » Remove breadcrumb from shop 'homepage'

Viewing 15 replies - 1 through 15 (of 31 total)
  • Plugin Author royho

    (@royho)

    You can use something like this in your functions.php

    [ Moderator note: pre works but please use the backtick or code button for code snippets. ]

    if ( is_home() ) {
         remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
    }

    I used this in the custom.css file in my theme. Worked like a charm:

    .home .breadcrumb {
        display: none;
    }

    Did this issue get resolved?

    I tried both of these options, and followed this page
    http://wcdocs.woothemes.com/codex/template-structure/

    and I still have breadcrumbs in my shop.

    The above suggestions didn’t work but I ended up finding this one and it worked like a gem!

    In woocommerce-config\config.php delete following code line:
    echo avia_breadcrumbs();

    Plugin Author royho

    (@royho)

    It didn’t work because your theme has its own breadcrumb namely avia_breadcrumb…

    @royho‘s suggestion is close for removing the woo breadcrumbs. i believe you just need to wrap that in a function and fire it on a hook. i usually remove things via the init or wp_head hooks

    function kia_remove_woo_crumbs(){
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
    }
    add_action('init','kia_remove_woo_crumbs');

    but as royho mentioned, this is irrelevant if your theme is serving its own breadcrumbs. in which case, you’ll need to dig into your themes and see if you can unhook them in a similar fashion.

    Plugin Author royho

    (@royho)

    Actually you don’t need to wrap that in a function. It is already being called..Because WooCommerce will fire off breadcrumbs within the callback of “woocommcerce_before_main_content”. So that remove line removes that function from being called.

    You can test this by putting it directly in your functions.php and it will work.

    good to know. i’ve always wrapped it in a function b/c i thought that remove_action wasn’t triggered the same way. thanks for the tip.

    Thanks hueyapan, that little bit of css did the trick nice and easy for me, saved me wading through the code myself! 🙂

    What worked?

    None of the solution above is working for me. I want to delete all woocommerce breadcrumbs from every page (like lmoore i am using yoast’s). With the above solution I can’t get it even from one page. I tried this too:

    if ( is_page('shop') ) {
         remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
    }

    Also doesn’t work. Anyone having a working solution for this problem?

    Thanks in advance!

    If you want to remove the breadcrumbs for specific pages, you can also do this in CSS. @hueyapan was close. In WP, each page has its own body class(es). You can target the breadcrumbs on that specific page like:

    body .post-type-archive-product .breadcrumbs{ display:none; }

    You can just inspect the page in the browser, there will be a lot of classes for the body, but you should be able to find and narrow down a good selector

    Roy Ho

    (@splashingpixelscom)

    @ryanwheaton – sorry but that is poor advice…hiding elements with CSS none is just bad practice. You should never do that unless you have no other choice.

    I found this which seems to work for me to remove the WooCommerce breadcrumbs on every shop page:

    remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);

    I added this to my themes custom functions.php file.

    Hey splashingpixels,

    You have been commenting on several threads about these breadcrumbs that hiding them by using CSS none is not a good option, so that’s clear. But can you also provide an alternative?

    I tried adding this code in my theme’s functions.php, header.php (where perfectly working Yoast breadcrumbs code is in) and woocommerce files breadcrumbs.php and several other WC files:

    remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);

    This all didn’t prevent the WC breadcrumbs from showing up on all shop pages. Do you know where to add this piece of code then?

    Thanks for your reply in advance!

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘Remove breadcrumb from shop 'homepage'’ is closed to new replies.