Changing breadcrumb structure
-
Already tried this with the woocommerce plugin support but that didn’t bring me a lot closer.
What we would like to have is that we can custom change the breadcrumbs.
And not sure how to fix it, That’s how we landed here. We’ve made custom pages; where we load & display products. The custom pages are in general ‘countries’ so like this:
https://ferrygogo.com/united-kingdom/
The products are the ferry lines to the UK (for example: https://ferrygogo.com/route/hull-rotterdam/), but the product categories can be similar to the custom page. We would like to have the breadcrumbs link back to the custom page, and make the product category a 301. Is there any way to fix this properly. Kind of a head breaker for me personally.
When I try to append the breadcrumb link it only works for one specific product even when adding more id’s. Here it works ‘sort of’ now for example:
https://ferrygogo.com/route/copenhagen-oslo/I would like the breadcrumb on single product page to be: Home » Ferry to Norway » Copenhagen-Oslo
add_filter( ‘wpseo_breadcrumb_links’, ‘yoast_seo_breadcrumb_append_link’ );
function yoast_seo_breadcrumb_append_link( $links ) {
global $post;if ( is_single( 11081, 11082, 11096, ) ) {
$breadcrumb[] = array(
‘url’ => site_url( ‘/ferry-to-norway-from-the-uk/’ ),
‘text’ => ‘Ferry to Norway’,
);array_splice( $links, 1, -2, $breadcrumb );
}return $links;
}Question is how do I make this work for more pages, what did I do wrong with the page id’s? And how can I get the product category out of the breadcrumb and have the custom page replace that one.
Really hope you can help out.
The page I need help with: [log in to see the link]
The topic ‘Changing breadcrumb structure’ is closed to new replies.