• milka21

    (@milka21)


    Hi,
    I would like to change “Brands” on breadcrumbs on the Brand-page
    (example: Home / Brands / Adidas).

    I saw a code for that in others topics here. But my site is multilingual (3 languages).

    So I need to change “Brands”and put a different word for every language.

    How can I do it?

    Thank you

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    hope you are doing well ??

    To change the “Brands” in the breadcrumb, you will need to add the following code to the functions.php file of your active theme and change the “THE TEXT YOU WANT HERE” text with what you want to display in the breadcrumb (instead of Brands):

    if ( ! function_exists( 'yith_brands_woocommerce_get_breadcrumb' ) ) {
    	function yith_brands_woocommerce_get_breadcrumb( $crumbs, $breadcrumb ) {
    		foreach ( $crumbs as &$crumb ) {
    			if ( 'Brands' === $crumb[0] ) {
    				$crumb[0] = esc_html__( 'THE TEXT YOU WANT HERE', 'yith-woocommerce-brands-add-on' );
    			}
    		}
    
    		return $crumbs;
    	}
    
    	add_filter( 'woocommerce_get_breadcrumb', 'yith_brands_woocommerce_get_breadcrumb', 10, 2 );
    }

    That string in the code has been added using the esc_html__ method, so you will be able to translate it. Then, you only need to scan the theme files in the translation plugin you are using (WPML, for example) and translate that string in the languages you want.

    Try it and let us know any news, please.

    Have a nice day!

Viewing 1 replies (of 1 total)
  • The topic ‘Changing breadcrumbs for multilingual site’ is closed to new replies.