Home › Forums › WoodMart support forum › Help with Blog breadcrumbs structure
Help with Blog breadcrumbs structure
- This topic has 5 replies, 2 voices, and was last updated 1 week, 1 day ago by
Luke Nielsen.
-
AuthorPosts
-
July 1, 2025 at 12:18 am #670745
andrea-2145ParticipantHi for my blog posts I want to have the breadcrumbs go back to the blog but instead the structure is Home > Blog Post Title.. But I want it to say Blog > Blog Post Title (so you can go back to the blog page from there instead of to the home page). I set this up on the Woocommerce Breadcrumbs to show Shop > Product category > Product Title by using the following code snippet:
/**
* Rename “home” in breadcrumb
*/
add_filter( ‘woocommerce_breadcrumb_defaults’, ‘wcc_change_breadcrumb_home_text’ );
function wcc_change_breadcrumb_home_text( $defaults ) {
// Change the breadcrumb home text from ‘Home’ to ‘Shop’
$defaults[‘home’] = ‘Shop’;
return $defaults;
}
/**
* Replace the home link URL
*/
add_filter( ‘woocommerce_breadcrumb_home_url’, ‘woo_custom_breadrumb_home_url’ );
function woo_custom_breadrumb_home_url() {
return ‘/shop/’;
}I was wondering if there is a way to do this same type of snippet but for the blog breadcrumbs? If so could you please help me come up with the right code to put in for the blog breadcrumbs I would really appreciate it.
If not, could you please explain how I can set up the Rank Math Breadcrumbs? Do I just copy over the single file breadcrumb.php from the parent theme under the Woocommerce/templates/global/ and just paste it in the child theme ? Do I need to copy over any other files or just that one (breadcrumb.php)? I would appreciate you being as specific as possible because I did read other posts which you explain it but you just say copy it and paste it and I just want to be sure it is just that file and I don’t need any other files.
Thanks!
July 1, 2025 at 12:57 pm #670872
Luke NielsenKeymasterHello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand if it is our theme’s issue or not?
In general, our theme doesn’t affect the breadcrumbs structure, we are using the default WordPress/WooCommerce structure.
Best Regards
July 1, 2025 at 7:36 pm #670993
andrea-2145ParticipantHi Luke,
I am not sure if you read my question, I didn’t mention that it was a theme issue, I was looking for some help with exactly what I said. I explained I am looking to make the breadcrumbs structure different and I shared a code I used to make the woocommerce breadcrumbs change but not sure if you could point me in the right direction as to what code I could use to target the blog breadcrumbs.If you could not help me with that, I asked specifically how to set up the Rank Math breadcrumbs. Do I just copy over the single file breadcrumb.php from the parent theme under the Woocommerce/templates/global/ and just paste it in the child theme ? Do I need to copy over any other files or just that one (breadcrumb.php)? I would appreciate you being as specific as possible because I did read other posts which you explain it but you just say copy it and paste it and I just want to be sure it is just that file and I don’t need any other files.
I am hoping you can please answer my specific questions especially if I need to copy over any specific other files or just drag that one file breadcrumbs.php and drop it in the child theme section. I hope that we don’t have to go back and forth for more days before you can be specific and answer my question.
Thanks
July 2, 2025 at 12:50 pm #671163
Luke NielsenKeymasterHello,
Unfortunately, we don’t have filters for breadcrumbs like in WooCommerce, but you can change the behavior of our breadcrumbs in the child theme by copying the
woodmart_breadcrumbs
function, which is located ininc/template-tags/template-tags.php
. This exact function is responsible for output on all other pages except WooCommerce pages. Also, in this very function, you can output breadcrumbs from Rank Math.Kind Regards
July 7, 2025 at 5:39 pm #672259
andrea-2145ParticipantHi Luke,
I am a little disappointed with your support help. I asked you two times to be specific with your help with setting up the breadcrumbs in Rank Math. I couldn’t have asked more times for your specific help on which files to copy over and how to do this. I am not sure if you don’t read the post and just respond too fast without putting much thought into what someone is asking. I hope that’s not the case but I will try one more time, so if you don’t think you can help maybe a different support person can help?
I am trying to figure out how to set up the Rank Math breadcrumbs. Since your theme doesn’t have built in way to implement I was hoping your support could be specific in exactly how to do this. For instance I saw on another post that the instructions were to “copy this file woocommerce/global/breadcrumb.php from the parent theme to the child theme keeping the same route. Then add Add the code:
if ( function_exists(‘rank_math_the_breadcrumbs’) ) {
rank_math_the_breadcrumbs();
return;
}
I just wasn’t sure what “keeping the same route” means and if that means I need to copy the folders woocommerce/global also, because on the child theme it doesn’t have those folders so the structure would be different. There is no detailed explanation as to how to do this in your theme and so I was trying to clarify exactly what the steps are to copy this over. Can you be specific and help me with this? You confused me when you said “you can change the behavior of our breadcrumbs in the child theme by copying the woodmart_breadcrumbs function, which is located in inc/template-tags/template-tags.php.”. That is different and more confusing than the other instruction and you didn’t even explain any further than that.July 7, 2025 at 5:53 pm #672262
Luke NielsenKeymasterIf you need to replace our breadcrumbs with a plugin on pages that are not shop pages, then use the following code by adding it to the child theme
function woodmart_breadcrumbs() { rank_math_the_breadcrumbs(); }
If you need to replace on all pages, then use the following code by adding it to the child theme:
function woodmart_current_breadcrumbs( $type, $return = false ) { if ($return) { ob_start(); } rank_math_the_breadcrumbs(); if ($return) { return ob_get_clean(); } }
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register