Hello,
Thank you for contacting Rank Math today.
You can use the following code in your theme template files to display the breadcrumb
Breadcrumb snippet, you can place this in your theme template:
<?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
OR
By shortcode, you can insert this to the pages:
I hope that helps, let us know if you need help with anything else.
Looking forward to helping you. Thank you.
Thanks, Febby,
But do you have a snippet where I can use in function.php file to automatically add it to those pages? all other pages are fine. I just need for these 2 specific pages.
Hello,
Thank you for keeping in touch with us.
You may use this code to add breadcrumbs to your page content. Specifically, prepend it in the content. Paste it in your functions.php
file and it should work.
function rm_breadcrumbs( $content ) {
if ( function_exists('rank_math_the_breadcrumbs') && is_singular() ) rank_math_the_breadcrumbs();
return $content;
}
add_filter( 'the_content', 'rm_breadcrumbs' );
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thanks, Jeremy,
This code didn’t add the breadcrumb to the Blog page, but instead, in all other pages, it added another breadcrumb next to the one I already had.
Let me make it easier: is there a snippet, that only adds the breadcrumb to the top of the blog posts list on the site.com/blog page? (the default page to show the list of blog posts)
Only this page is enough. I’ll take care of the Docs page by myself, as it is a 3rd party plugin. But Blog is part of the WP itself, so might be able to help me with it.
Thanks
Hello,
We might need to take a closer look at your site. Because sometimes we need to customize the code based on how the site works.
Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
I’m sorry but I encountered an error on your site. We need FTP access to fix this. We need to de-activate the code snippet plugin again to fix the error. I understand the issue on the server but I think we really need FTP access to avoid this kind of error.
Thank you, and looking forward to your update.
Hello,
We want to clarify that your Blog Page does not need a breadcrumbs section. The whole purpose of a Breadcrumb is for users to easily know where they are in relation to your homepage. It is most suited for single posts/pages/products and anywhere else – it does not add any value.
With that said, we really need the FTP to help you further as we do not know how your theme works and if we paste any incorrect code, we need FTP access to bring your website back online.
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.