Replace Full Woocommerce Breadcumb show in FrontEnd with Rankmath Breadcumbs

#129953
  • Resolved R Abedin
    Rank Math free

    hi, i want to change woocommerce default breadcumbs with rankmath breadcumbs, what can i do ? can you help me to fix this problem with snippet or … ? thank you for your best support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sajid Khan
    Rank Math business

    Hello,

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

    You can remove the WooCommerce breadcrumbs on most themes by adding the following code snippet on your theme’s functions.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 );
    }

    The next step will be add the Rank Math breadcrumb snippet on the section that you want them to appear. The code required to show the RM breadcrumbs is shown below:

    <?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
    

    Looking forward to helping you. Thank you.

    ​​​​​​​

    thank you for your fast reply … i put this code in function.php of child theme but the breadcumb not removed. i still set the breadcumb display to none but i need to remove completely this from all page and replace the rm breadcumb … thanks

    Hello,

    If the code provided to remove the breadcrumbs don’t work, you will need to get in touch with the plugin support.

    Make sure that the breadcrumbs showing are actually from WooCommerce. Once done removing this, you can get in touch with us so we can guide you on adding Rank math breadcrumbs to your pages.

    Looking forward to helping you

    hi again, i remove completely woocommerce breadcrumbs from all page, Now How do I add rankmath breadcrumbs with theme function.php ?

    Hello,

    Sorry for the delay.

    Please paste the code below in your theme’s functions.php file, and it will display Rank Math breadcrumbs on your WooCommerce product page.

    /**
     * Add Rank Math Breadcrumbs 
     */
    add_action(
        'woocommerce_before_main_content', 'woocommerce_custom_breadcrumb'
    );
    function woocommerce_custom_breadcrumb(){
        echo do_shortcode('[rank_math_breadcrumb]');
    }

    I hope that helps. Thank you, and looking forward to your update.

    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 ‘Replace Full Woocommerce Breadcumb show in FrontEnd with Rankmath Breadcumbs’ is closed to new replies.