I’ve noticed that the breadcrumbs on product pages of products that are within a subcategory have the parent category stripped from the breadcrumb.
E.g If I have Home -> Product Parent Category -> Product Sub Category -> Product, the breadcrumb renders “Home” >> Product Sub Category >> Product.
Breadcrumbs for products within parent categories render fine…
How do I fix this?
Please try the custom breadcrumb code I posted here: http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page – I asked Kriesi to use it for the next update.
Thanks for the help, I’m a little unsure as to what code to replace, could you possibly give me a block to search for?
Yes, open up abundanceframeworkphpclass-breadcrumb.php and replace following code with the custom php/breadcrumb code:
/* If there's an archive page, add it to the trail. */
if ( !empty( $post_type_object->has_archive ) && function_exists( 'get_post_type_archive_link' ) )
$trail = '<a href="' . get_post_type_archive_link( $post_type ) . '" title="' . esc_attr( $post_type_object->labels->name ) . '">' . $post_type_object->labels->name . '</a>';
I replace the code, but the breadcrumbs for the subcategories are still being stripped…
Strange, it seems to work on my test server. I’ll mark this thread for Kriesi because he needs to update the breadcrumb class anyway and then he can do some testing with sub categories, etc. too.
The topic ‘Product Page Breadcrumbs’ is closed to new replies.