Breadcrumbs

#386087
  • I’m having some issues setting up the Breadcrumbs properly. Right now I have Home > Specific product, but I want it to be Home > All Products > Specific product and I can’t figure out how to do this. I’ve made the website menu so the specific products are under All products, but the don’t figure in the breadcrumbs. Is there a setting I’m overlooking so I can get the total of the breadcrumbs as I wish it to be?

    Best
    Katrine

Viewing 1 replies (of 1 total)
  • Prabhat
    Rank Math agency

    Hello,

    Thank you for contacting the support and we regret the inconvenience caused.

    On the product pages, all products/shop pages are shown based on the permalink structure.

    However, as we do not recommend changing the permalink structure on live websites, you can achieve this using a custom filter:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	if(is_product()){
    		array_splice( $crumbs, 1, 0, array(array(
    			"All Products",
    			"https://yourwebsite.com/shop/",
    			"hide_in_schema" => false
    		)) );
            }
    	return $crumbs;
    }, 10, 2);

    You can add the above filter to the website after replacing the https://yourwebsite.com/shop/ with the actual URL of the All Products Page and see if it gives you the desired output.

    Here’s a guide that you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope this helps.

    Thank 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.

Viewing 1 replies (of 1 total)

The ticket ‘Breadcrumbs’ is closed to new replies.