breadcrumbs_home_label dont translate by polylang

#471281
  • Resolved Mohammad Abu Al-Rub
    Rank Math free

    hello

    i use polylang plugin to make my site with two language

    and when i setup the breadcrumbs in your plugin Rankmath the Homepage label show in Strings translations
    in polylang plugin but when i translate it, the translation dosent work in my othe language pages .

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    It seems that you have already marked this ticket as already resolved. Could you please confirm?

    Meanwhile, you can use and customize this filter on your site:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    
    	$home_link = pll_home_url(pll_current_language());
    
    	$crumbs[0][0] = pll__("Home");
            $crumbs[0][1] = $home_link;
    
    return $crumbs;
    }, 10, 2);

    The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    Looking forward to helping you.

    Thank you.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.