Custom Woocommerce Shop page as breadcrumb

Hello,

I’ve created a custom Woocommerce Shop page using Cornerstone but did not assign it as the Shop page within cornerstone (so I can keep it custom). The problem is that the assigned Shop page (“Store”) is the one that shows in the breadcrumbs. How can I get my custom, unofficial Shop page to show in the breadcrumbs?

Hey Jonathan,

It’s possible to achieve that by filtering the breadcrumbs or using the breadcrumbs hook. Here’s the guide from our lead developer Kory: https://theme.co/apex/forum/t/modify-the-breadcrumb-element/24923/4?u=christian_y

Here’s a thread that is closely related to what you need: https://theme.co/apex/forum/t/breadcrumbs-with-custom-blog-page/47130/2?u=christian_y. The code there is to change the blog index for single post breadcrumbs.

Your case is to change the shop index for single product breadcrumbs so in theory, in the code provided in that thread, you should just change is_singular('post') to is_singular('product') and change the post ID to your custom Shop page.

Hope that helps.

Thank you.

That worked for the single product pages, but I also need it to work for the category pages.
I tried
if ( is_singular(‘product’) || is_singular(‘product_cat’) )
and
if ( is_singular(‘product’) || is_singular(‘product_category’) )

These are just guesses on how to target the product category but neither are working.

Thanks for your help.

Hello Jonathan,

Thanks for updating the thread.

You will need to use a different conditional tag for category. I request you to please take a look at following article.

Thanks.

Thank you!

You’re welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.