Polylang menu not changing regarding to selected language
-
Hi everyone,
I’m new on this forum and for the first time i’m creating a website with wordpress.
I’m using the theme “Tesseract” and Polylang and the problem is that I can change the pages or the articles languages once i’m on these pages but the menu stays in the default language (french). What i want is to have a menu changing regarding the language selected.
I have seen some posts about this but most of the time there is a part of the code to change in headers.php but i’ve never done that before so i never know if the code written on these posts is adapted to my theme or what want so i thought it may be better to ask you directly.Here is the post where i think there is a part of the answer: https://wordpress.org/support/topic/plugin-polylang-multilingual-menus-1?replies=4
I have checked the menu as told and here is what I have:
if ( $anyMenu && ( ( $menuSelect ) && ( $menuSelect !== ‘none’ ) ) ) :
wp_nav_menu( array( ‘menu’ => $menuSelect, ‘container_class’ => ‘header-menu’ ) );
elseif ( $anyMenu && ( !$menuSelect || ( $menuSelect == ‘none’ ) ) ) :
$menu = get_terms( ‘nav_menu’ );
$menu_id = $menu[0]->term_id;
wp_nav_menu( array( ‘menu_id’ => $menu_id ) );
elseif ( !$anyMenu ) :
wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’ ) );
endif; ?>Adn I have it twice in the code headers.php
I hope this will help you to understand and that you may find the solution to my problem!Thanks in advance!
-
Hello
I suggest you read this topic and report the bug to your theme author: https://wordpress.org/support/topic/my-main-menu-doesnt-change-language
Thank you so much !
Do you know how i can do the same for the footer ? Cause I had a look at the code and it’s slightly different.Thanks again !
I don’t know but you should see that with the Tesseract theme author.
Hey Safoo.22 did u find solution for the footer menu language too finally?
Could u share it?I found the solution for the footer menu, too:
Themes Customization—-> Menus—> Select the menu of the language you want to traslate in—-> Menu locations, here check the header and footer small squares of the language u wanna to translate in.
No need for changing the footer.php file.
🙂
The topic ‘Polylang menu not changing regarding to selected language’ is closed to new replies.