Change Breadcrumb

#83949
Viewing 3 replies - 1 through 3 (of 3 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    That is something you can easily achieve by using our filters if you know about coding or if you hire a freelancer to do it for you. You should use this filter:

    /**
     * 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.

    ​​​​​​​

    flober
    Rank Math business

    Here the solution. If in future you can integrate https://de.wordpress.org/plugins/perfect-woocommerce-brands/ with Rank Math, was great!

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    if (is_tax('pwb-brand')){
    $modifiedCrumb = array(
    				"0"=>esc_html('Brands'),
    				"1"=>esc_url('/brands/'),
    				"hide_in_scheme"=>false
    			);  
                    $crumbs[count($crumbs)-2] = $modifiedCrumb;
    }	
    	return $crumbs;
    }, 10, 2);
    • This reply was modified 4 years, 2 months ago by flober.

    Hello,

    Thank you for sharing.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Change Breadcrumb’ is closed to new replies.