-
The breadcrumb in the 2nd page of blog is as follow:
Home » Blog » Page 2
Home is linked to the homepage. I want the 2nd part which is “Blog” link to the blog page as well (which is not right now). Would you please lead how to do it?
Pleasure
-
Hello,
Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.
To set your blog page URL to the blog in breadcrumbs, you may try adding the following filter:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) { $crumbs[1][1] = 'Your Blog URL'; //use the URL of your blog page return $crumbs; }, 10, 2);Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank you.
Thx a lot Md. Sakib Khandaker. It is working
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.
Dear Md. Sakib Khandaker
I have added the code you sent me and it is working well for blog breadcrumbs. But I face a new problem with other post types breadcrumbs. I have other post types such as career, services, solutions, case studies. And all breadcrumbs are linked to blog right now. for example in following breadcrumb:
Home » career » Senior Forensic Structural Engineer
Career is linked to blog page and there is the same problem for other post types. Would you please lead me how to solve it?
Best regardsHello,
Please modify the code snippet to the following:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) { If( 'Blog' == $crumbs[1][0]){ $crumbs[1][1] = 'Your Blog URL'; //use the URL of your blog page return $crumbs;} }, 10, 2);Hope that helps. Please let us know if you have questions.
Hi Nigel
I really appreciate your answer but unfortunately the code doesn’t workHello,
Can you please try replacing the code snippet you have currently with the following one to see if that works for you?
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) { if($crumbs[1][0] == 'Blog'){ $crumbs[1][1] = 'Your Blog URL'; //use the URL of your blog page } return $crumbs; }, 10, 2);Let us know how it goes. Looking forward to helping you.
Thank you.
Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/mfsengineering.com.au/public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php on line 137
Warning: Invalid argument supplied for foreach() in /home/customer/www/mfsengineering.com.au/public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php on line 143
The code you have sent does not work unfortunately. when I add it, the above error was shown instead of breadcrumbs in pages
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
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.
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.
The ticket ‘Blog Breadcrumb’ is closed to new replies.