• 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 15 replies - 1 through 15 (of 24 total)
  • Plugin Author Chouby

    (@chouby)

    Could you give me a link ?

    Thread Starter acjo

    (@acjo)

    https://www.acjowedding.com/
    Work in progress ??

    Plugin Author Chouby

    (@chouby)

    So if I well understand, you created 2 menus (one in French, one in English) in Appearence->menus

    then you went to Settings->languages->menus
    You assigned each menu to its language
    You checked “Displays a language switcher at the end of the menu” and “Display flags”
    And it does not work as expected. Am I right ?

    Thread Starter acjo

    (@acjo)

    That is exactly what i have done. And the menu french is the only one i see.
    Ps. Thanks for the quick response.

    Plugin Author Chouby

    (@chouby)

    Well, it seems that your theme does not work in a standard way. For example, there is such an issue with Artisteer generated themes.

    Could you look into your theme files (generally header.php) if there is a call to the function wp_nav_menu ?

    Thread Starter acjo

    (@acjo)

    Ok. I could not seem to find the function wp_nav_menu in the theme files.

    I am not an expert php programmer so I could not really adapt the solutions in the links you gave me above to my own problem.

    If it’s any help to you, this is the theme that I have downloaded and used :
    https://graphpaperpress.com/themes/fullscreen/

    Hi Chouby,

    Thanks for explaining the topic.

    I have another issue, I installed Boldly theme on my WordPress (androidmonsters.com) and I struggle with homepage translation. The matter is that Boldly uses special options for homepage, including slider and columns which. In special boldly menu I can chose from pages which to assign for columns.

    I don’t have a homepage page available for edit, so don’t know how to create another language version for homepage.

    Appreciate your ideas very much.

    Sergey

    Plugin Author Chouby

    (@chouby)

    @acjo

    I did not believe the solution for artisteer themes would work for yours. It was just to say that a lot of themes don’t use a standard way of creating menus and unfortunately I cannot imagine all them !

    If you did not find wp_nav_menu, it’s not a good start… However I do not want to register. Please upload a zip file of your theme on your server and post a link here. I will try to look into the source code if I can find some time.

    @sergeyl1984
    Create a plugin or a child theme. And add this code:

    <?php if (function_exists(pll_get_post)) {
    	add_filter('option_boldy_slider', 'my__boldy_slider');
    	function my_boldy_slider($value) {
    		return pll_get_post($value);
    	}
    }
    ?>

    Then create a translation of your ‘Homepage Slider Images Page’. It should allow you to use different images on both homepages.

    Just look in the file home.php of your theme. You will see the other options used by your theme. You can do things similar as above (using pll_get_post to translate pages and posts and pll_get_term to translate categories and tags).

    Thread Starter acjo

    (@acjo)

    Ok I will upload the theme as soon as possible.

    Searching in the Header.php file I found that the menu is called by this function:

    <?php fullscreen_theme_nav(); ?>

    Does this help in any way? Looks like it is a custom function.

    Plugin Author Chouby

    (@chouby)

    No it doesn’t help. I will need to look into the source code of this function to see how the menu is built.

    Thread Starter acjo

    (@acjo)

    Here is a link to download the zip:
    https://skydrive.live.com/redir.aspx?cid=39a988e8091310f3&resid=39A988E8091310F3!146&parid=39A988E8091310F3!142&authkey=!AFwllW7uIPc66uc
    PLease let me know when you have doanloaded it so I can take the files down. THanks

    Plugin Author Chouby

    (@chouby)

    You can remove the link.

    Plugin Author Chouby

    (@chouby)

    Well… The theme is using the standard way of creating menu (wp_nav_menu). But it is buggy as it is using a parameter not recognized by WordPress. It works on a monolingual site which created only one menu just because WordPress fallbacks to the first menu in that case.

    The correction is easy. Edit the file functions.php at line 41 and replace:

    wp_nav_menu( 'sort_column=menu_order&menu_location=main-menu&container_id=nav&menu_class=sf-menu' );

    by

    wp_nav_menu( 'sort_column=menu_order&theme_location=main-menu&container_id=nav&menu_class=sf-menu' );

    You can send a bug report to the author. It may help someone else ??

    Thread Starter acjo

    (@acjo)

    Brilliant! It works perfectly. Thanks alot.
    Now I just have to play around witht he CSS a little but to get the flags positioned just how I want them.
    Thanks for your help, you’re a life saver.

    @chouby

    Thanks a lot for reply and guidance, as I am new to WP, would very appreciate if you can explain how to create a plugin or a child theme. And where to add the code you mentioned?

    Thanks!
    Sergey

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