WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » Remove breadcrumb from shop 'homepage'

Remove breadcrumb from shop 'homepage'

Viewing 15 replies - 16 through 30 (of 31 total)
  • Roy Ho

    @splashingpixelscom

    @emielm – did you not see my reply? I am the first one who answer the OP with an solution in CODE. And the OP didn’t state they were using Yoast breadcrumb. They’re using default WooCommerce breadcrumbs. Not sure if that has anything to do with your issue.

    @splashingpixels – That solution wasn’t working for me, but I figured out why in the meantime. The solution code you offered in the first reply is working indeed, but in my case it had to be placed in header.php (themefile) instead of functions.php. As told I tried that before, but entered it outside an if-statement where is had to be inside, so that’s why it wasn’t working.

    Conclusion:
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0)

    is working fine, but you might have to insert it in another file then functions.php (and properly insert it of course 😉 )

    Roy Ho

    @splashingpixelscom

    @emielm – it didn’t work for you because you’re not asking the same question as OP is. He wants to remove the DEFAULT breadcrumb from only the homepage. My code does exactly that. You on the other hand seem to want to remove the default breadcrumb completely so you can replace it with Yoast’s breadcrumb…So I am not sure why you would say my solution is not working when it is not related to your question?

    “You on the other hand seem to want to remove the default breadcrumb completely so you can replace it with Yoast’s breadcrumb…”
    That’s why I used your code without ‘if ( is_home() )’ statement. Yoast breadcrumb has nothing to do with it, these work perfectly on our site, as I told before. Your code except the if statement wasn’t working in functions.php, but it DID WORK in header.php, that’s all I said in my last post before this one to help others having this issue too. So thanks again for your piece of code, we are very happy with it.

    Roy Ho

    @splashingpixelscom

    @emielm – if possible don’t put that in the header.php as it doesn’t belong there. It should work in functions.php. I urge you to test it again.

    I eventually found the solution for removing the default breadcrumbs (from ALL pages though, not just the home one as the OP requested) and replacing them with the Yoast WP SEO ones instead – see this thread for details:
    http://wordpress.org/support/topic/replacing-woocommerce-breadcrumbs-with-yoast-seo-ones

    James 🙂

    Hello,

    I am using a php based template called Pindol from themeforest.net or muffingroup.com.

    I am trying to remove the breadcrumbs. I have had some bad luck editing the php as I am such a newbie with php that I am scared to mess with it and can’t find any of the code mentioned above. I am looking for a Custom CSS solution. None of the previously suggested Custom CSS options have worked for me. Can anyone take a look at that template code and let me know specifically what I can do to get rid of these without breaking my template?

    I really appreciate any feedback.

    Thanks!
    John

    To change hueyapan’s solution up a little. I noticed in my wootheme that the breadcrumbs style was calling #breadcrumbs and not .breadcrumbs so I used:

    .home #breadcrumbs {
        display: none;
    }

    And it worked.

    @rconserta,

    Thanks for sharing, it really worked!

    This worked best for me:

    add_action('template_redirect', 'remove_shop_breadcrumbs' );
    function remove_shop_breadcrumbs(){
    
    	if (is_shop())
    		remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
    
    }

    So whats the best code to use if you want to remove Woo Commerce default breadcrumbs from all shop pages?

    Roy Ho

    @splashingpixelscom

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

    In your theme’s functions.php

    sorry, but NOPE ! not in my “superstore” theme..Weird..TRIED ALL sugs in various files with zeroooo desired results.the ONLY thing that words is “display: none;” in css..last resort…yep

    This is a method to hide the breadcrumbs by adding this code to custom.css :

    .home #breadcrumbs {
        display: none;
    }

    This is not recommended. What it does is just hide the text. But the breadcrumbs are still executed, so you still get a huge blank empty space gap which represented the breadcrumbs. It is not good enough. Editing the functions.php as described below is preferred.

    Okay, I am made to understand that if you want to remove breadcrumbs, ONLY from your homepage add one of this to your functions.php:

    Option 1: If you are using a default homepage, use this:

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

    Option 2: If you are using a static page , use this:

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

    I am using a static page. I tried the code above, but it doesn’t work.
    It is supposed to work, according to all WordPress help documents, it is supposed to return “true” that it is a static page and then execute the remove breadcrumbs. But it doesn’t work. The static page I used has no title, as this was done to prevent getting 2 Home button on the Top Menu. I tried a different static page with a title, but it still didn’t work.

    So, any better tricks?

    Thank you hueyapan. Worked a treat! 🙂

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