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.
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.
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.