Setting breadcrumbs translation

#185748
  • Resolved Horti Advisor
    Rank Math free

    Good morning,

    I have a problemw with setting “HOME” translation in RankMath breadcrumbs.

    I use Polylang and Oxygen.

    1. Already added php code which was mentioned at forum few times – no effect.
    2. Already set string translation home – without effect.

    I have tried already everything what has been stated here at forum and nothing works.

    How to solve this issue? Looks like problem was mentioned long time ago and it is still not solved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I dont know why I cant edit post so I will reply.

    I have found that the link to home page has changed but now the problem is front-end output – in this case homepage title in different language is not changed so it shows it still in english.

    As I mentioned I have done already string translation but it does not work.

    Ankit
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    Please replace the previous code with the following code:

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

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

    Provided code works for displaying the name of multilingual home page but it does not change the URL.

    OK, by adding another line of code with 0 0 array it wis working.

    Ankit
    Rank Math business

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

You must be logged in to reply to this ticket.