• Resolved acjo

    (@acjo)


    Hello,
    First of all thanks for the great plugin I really enjoy using it on my site.

    I wonder if you can help me with a bug that I have. I am using the theme Fullscreen by GraphPaperPress. I am able to create pages in 2 languages and have them change between languages without a problem. However the menu always stays fixed and never changes language.

    When I come to the homepage (created one english and one french menu) the change does not work:
    1. I don’t see the flags to change language on the home page at the end of my menu.
    2. The default menu is english BUT I only ever see the french menu on the homepage or pages.
    If I type =en ou =fr in the url, the menu stays stuck on french.

    Can you tell me why the menu’s don’t change language even thought the site (url) and pages do?

    For info, the 2 menus are not identical, does this have an impact?

    Thank you very much for your time.

    https://www.ads-software.com/extend/plugins/polylang/

Viewing 9 replies - 16 through 24 (of 24 total)
  • Plugin Author Chouby

    (@chouby)

    The best is the personal plugin and its creation is very simple:

    Create a new file in your favorite text editor and paste this:

    <?php
    /*
    Plugin Name: MyPlugin
    */
    
    if (function_exists(pll_get_post)) {
    	add_filter('option_boldy_slider', 'my__boldy_slider');
    	function my_boldy_slider($value) {
    		return pll_get_post($value);
    	}
    }
    ?>

    Save it as ‘whateveryouwant.php’. Then upload the file in wp-content/plugins/ directory. You then go activate your plugin in the plugins table an that’s all !

    To know more:
    https://codex.www.ads-software.com/Writing_a_Plugin
    https://codex.www.ads-software.com/Child_Themes

    @chouby

    Hi, we have a similar menu problem. We have a custom built theme, using
    <?php wp_nav_menu(); ?> and <?php pll_the_languages(array(‘show_flags’=>1,’show_names’=>0)); ?> in header file.

    We have followed instructons/settings for installing Polylang and everything seems to work but the menu. We have 2 menus (created in admin), one in swedish and one in english. But the menu stays in swedish at all times, while content changes to english when you press the english flag.

    Can you possibly know what can be missing? Here’s a link to the site; https://www.processtodstockholm.se

    Thanks in advance.
    Emily

    @chouby

    Hi again,

    Solved it with this https://www.ads-software.com/support/topic/plugin-polylang-multilingual-menus-1?replies=4

    You should add this in the instructions:

    For Polylang to work, the theme_location must be defined but not the menu.

    Something like:
    wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?> is OK

    Something like:
    wp_nav_menu( array(‘menu’ => ‘Project Nav’ ));
    is not OK

    =) Great plugin!! Best regards /E

    Dear Chouby

    I love the theme however I’m having the same problem as well as a couple of others. I have created two menus, one for English (default one) and one for German. I set everything accordingly in Settings > Languages > Menus as mentioned above.

    The problems I’m having:
    – The menu does not change when the language flag is clicked
    – The string translations do not work
    – The widgets do not change accordingly to the chosen language (I added every widget twice, once for each language and set “The widget is displayed for” to the according language)

    The theme was created by myself (I used WP’s twentyeleven as a blueprint) and the menu is being created with the following line in my header.php:
    <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

    The website is: https://www.865artist.com

    I hope you’re still gonna see my post since the last answer was written four months ago.

    Thanks

    I found the problem. It is a plugin called ‘Theme My Login’ which enables you to create individual pages for the login, reset password and register pages.

    I really want that plugin though so if anyone can help me to allow both plugins to work together I’d be very grateful.

    imarosi

    (@imarosi)

    Hi, I’m having a similar problem with my theme as well. the menu is called with

    <?php wp_nav_menu('main'); ?>

    and I can’t get polylang to switch menus while on different languages. if I substitute the wp_nav_menu code with

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

    the menus show perfectly but they don’t apply a specific CSS style. i just started working with WP so I’m not that good with it’s syntax. any help is apreciated.

    Plugin Author Chouby

    (@chouby)

    Your theme author did not read the wp_nav_menu documentation… It’s pure luck if it works as expected. Just because most users do not create more than one menu.

    Is your theme coming with an already existing menu called ‘main’?
    If yes, I would try ‘menu-main-container’ as value for ‘container_class’ instead of ‘menu-header’.

    Shoeb

    (@lovemarshall)

    Hi Chouby,
    Wondering if you could help me on this please.
    I have same problem and here is the header and the functions file.
    Could you please suggest a solutions.

    [ Code moderated. Please use pastebin.com instead. ]

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @lovemarshall as this has been marked resolved already and it’s a different problem then yours please start your own topic instead.

    https://www.ads-software.com/support/plugin/polylang#postform

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘[Plugin: Polylang] menu for a theme does not change language’ is closed to new replies.