Primary category for breadcrumbs ignored

#344151
  • Resolved Beauty Crush
    Rank Math free

    Hi guys,

    I am having the same problem as discussed here: https://support.rankmath.com/ticket/woocommerce-breadcrumb-bug/

    I am happy to use that bit of code if the fix has not been released, but the bug was reported 2.5 years ago so I’d thought Id ask first to see if there is something wrong with my config instead.

    I have followed all instructions to set up Primary categories, which work fine except for breadcrumbs. I have cleared cache also.

    Thanks.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have checked your site https://beautycrushskin.com.au/mugwort-mask-110g/ and it seems that the breadcrumbs are being displayed by the WooCommerce plugin.

    “Primary category” functionality is offered by the Rank Math plugin. WooCommerce does not have this option by default and if you want to display “Primary category” in the breadcrumb, I suggest you use the Rank Math’s Breadcrumb functionality.

    You can activate the breadcrumbs setting in Rank Math from Rank Math > General Settings > Breadcrumbs.

    Then add the Rank Math’s breadcrumbs code to your theme’s template files, and the breadcrumbs will appear on your website’s front-end accordingly.

    /**
     * Use the following code in your theme template files to display breadcrumbs:
     */
    <?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
    

    Paste the above code directly into your theme’s single.php or header.php wherever you prefer showing it.

    Here is a guide that might help you:
    https://rankmath.com/kb/breadcrumbs/#add-breadcrumbs-theme

    You can also use this code snippet in your theme’s functions.php file to remove Woocommerce breadcrumbs from all pages:

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

    Hope this helps.

    Looking forward to helping you. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Primary category for breadcrumbs ignored’ is closed to new replies.