Breadcrumbs link

#150110
Viewing 7 replies - 1 through 7 (of 7 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused

    You can make use of the following filter to change or remove breadcrumb items:

    /**
     * Allow changing or removing the Breadcrumb items
     *
     * @param array       $crumbs The crumbs array.
     * @param Breadcrumbs $this   Current breadcrumb object.
     */
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	return $crumbs;
    }, 10, 2);

    The filter should be added to your active theme’s functions.php file.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Sir, I want to change the link from “Shop” to “Store”. How to change this.

    Hello,

    Do you wish to say that your shop is shown as store or is it that you have a store and a shop separate?

    Either way, you can try the following:

    
    add_filter( 'rank_math/frontend/breadcrumb/html', function( $html, $crumbs, $class ) {
    	$html = str_replace('<a href="yourShopURL">Shop</a>', '<a href="yourStoreURL">'Store'</a>', $html);
    	return $html;
    }, 10, 3);
    

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Where is this code included?

    Hello,

    Thank you for keeping in touch with us.

    You may include this code in the functions.php file of your theme file.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Sir, this problem come when i add this code. https://prnt.sc/zbk9pb

    Hello,

    Thank you for following up.

    Could you confirm if you have a separate page named Store for your shop page? If so, you can head over to WordPress Dashboard > WooCommerce > Settings > Products Tab and click the drop down button to choose a page for your /shop URL
    Change Shop Page

    If that didn’t help, could you please check if you have already changed the yourShopURL and yourStoreURL in the filter above?

    I hope that helps. Thank you, and looking forward to your update.

    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 7 replies - 1 through 7 (of 7 total)

The ticket ‘Breadcrumbs link’ is closed to new replies.