polylang breadcrumbs wrong homepage

#481390
  • Resolved eslam saker
    Rank Math free

    hey, I just set up polylang plugin to translate my website but I have a problem with rank math breadcrumbs. my website has two versions English version and the Arabic version the breadcrumbs of the Arabic version appear in the English version which destroys how bread crumbs looki tried to modify homepage label but the same affect happens in the two versions

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.

    In this case, please try to use and customize this filter on your site:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    
            if(pll_current_language() == 'en') {
                $crumbs[0][0] = 'Home';
            }
    
    	$home_link = pll_home_url(pll_current_language());
            $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

    Let us know how this goes.

    Thank 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 1 replies (of 1 total)

The ticket ‘polylang breadcrumbs wrong homepage’ is closed to new replies.