-
Hi,
I use Polylang for multilanguage and my breadcrumbs in the second language do not display name label correctly the URL change but not the label using this code/** * Change the Home URL in breadcrumbs according to the current language in Polylang * * @param array $crumbs The crumbs array. * @param Breadcrumbs $this Current breadcrumb object. */ add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) { // With this code, we get the home URL with the current language $home_link = pll_home_url(pll_current_language()); $home_label = pll_home_url(pll_current_language()); // The first item in the $crumbs array is usually the home (except if it is disabled // The second item inside each item is the link (so in this case, the home link) $crumbs[0][1] = $home_link; $crumbs[0][1] = $home_label; return $crumbs; }, 10, 2);
i don’t want to use css to fix it i need to make sure google reads it correctly if you can help
thank you
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
The ticket ‘Breadcrumbs homepage label with language polylang’ is closed to new replies.