bread crump

#159251
  • Resolved Matty
    Rank Math free

    Hi 🙂

    I set primary categories for my woocommerce products, and the permalinks work just awesome. Thanks a lot for that functionality.

    However the bread crumps still show the alphabetical standard woocommerce categories eg:

    Product: cooltshirt
    Primary category: Tops
    Other category: launch collection

    –>
    Permalink: website.com/tops/cooltshirt
    Breadcrump: Launch Collection > Cooltshirt

    I want the primary category in the breadcrumps as well. I have made the settings: WordPress Dashboard > Rank Math > Titles & Meta > Products > Product Taxonomy

    Mine is currently set to [Product Categories]. There is NO option for “Primary Category”.

    The options to choose from are as follows:
    None
    Product Categories
    Product Tags

    I use this theme: https://themeforest.net/item/savoy-minimalist-ajax-woocommerce-theme/12537825 which just utilizes the core woocommerce breadcrumps.

    Any help would be appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    You’re using WooCommerce breadcrumbs on your site. To use the Rank Math breadcrumbs first disable the WooCommerce breadcrumbs by adding the following code in your theme’s/child theme’s function.php file:

    /**
     * Remove the breadcrumbs 
     */
    add_action( 'init', 'woo_remove_wc_breadcrumbs' );
    function woo_remove_wc_breadcrumbs() {
        remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
    }

    You can also refer to the following article for more details: https://docs.woocommerce.com/document/customise-the-woocommerce-breadcrumb/

    After that navigate to WP Dashboard > Rank Math > General Settings > Breadcrumbs and Enable the Breadcrumb function

    Then paste the following code in your theme’s/child theme’s function.php file

    <?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>

    This will enable the Rank Math breadcrumbs on your site.

    Hope this helps. Let us know if you need any further assistance.

    Matty
    Rank Math free

    thanks a lot for the swift reply.

    Do you really mean i should add

    <?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>

    to the child theme’s funtion.php? it throws an error when i add it

    Hello,

    Try adding the code without opening and closing PHP tags.

    if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs();

    Let us know if this works for you or not. We really look forward to helping you.

    Matty
    Rank Math free

    mhmm. actually even if i add this code here, the old breadcrumps still show:

    /**
    * Remove the breadcrumbs
    */
    add_action( ‘init’, ‘woo_remove_wc_breadcrumbs’ );
    function woo_remove_wc_breadcrumbs() {
    remove_action( ‘woocommerce_before_main_content’, ‘woocommerce_breadcrumb’, 20, 0 );
    }

    if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs();

    Hello,

    Thanks for the follow-up. If that code doesn’t work, you can use this code:

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

    I checked and it works fine for me.

    Hope this helps. Let us know if you need any further assistance.

    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 5 replies - 1 through 5 (of 5 total)

The ticket ‘bread crump’ is closed to new replies.