create unique Breadcrumb for page

#77314
  • Resolved Sun Shine
    Rank Math free

    Hello there,

    Is it possible to create a unique and different breadcrumbs with a shortcode for different kind of pages?

    For example:
    I have this

    Page → woocommerce category → woocommerce product

    In this page, I put the rankmath breadcrumb (top of page) and it shows like this :Accueil – Métiers de l’hôtellerie et de la restauration – BARMAN/BARMAID

    Instead of “accueil” (home), I’d like to connect the woocommerce category to a unique page.

    I have like 10 different pages that are linked to 10 different woocommerce cat.
    Is it possible to create unique and personnalized breacrumbs with shotcodes ?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math today.

    Yes, you could achieve it by using a filter from our API, but you would need to customize it to fit your needs. The filter is:

    /**
     * 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);

    Looking forward to helping you. Thank you.

    ​​​​​​

    Where do I add this piece of code?
    At the end of rank-math.php?

    Hello,

    Once you have customized the code, you can add it to your theme functions.php.

    Hope that helps. If you have any further question(s), please let us know. Thank you.

    Alberto
    Rank Math business

    Hello,

    You should add it at the end of your functions.php in your active theme (or create a plugin that adds this function).

    But keep in mind you need to customize the code to fit your needs (or hire a freelancer to do it for you).

    Looking forward to help 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 4 replies - 1 through 4 (of 4 total)

The ticket ‘create unique Breadcrumb for page’ is closed to new replies.