Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using WordPress 3.0 Menus, which the WPML (wordpress multilingual) plugin claims to have added support for in a recent release. I am using the most current version of the plugin.

My problem is that using the following to call my nav menus

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

is pulling up only the English translation of the menu.

Here is an image of the WPML admin panel and how the menus are setup multilingual:

[link to image] http://cl.ly/42RW [link to image] http://cl.ly/42o0

You can see the site currently in development:

http://anasmadance.com.s66112.gridserver.com/

The problem is that when you go to the French translated page, the menu is still in English (despite the fact that I've already set up the French menu)

http://anasmadance.com.s66112.gridserver.com/fr/

share|improve this question
    
Can you check if it works with the default theme. –  Wyck Jan 16 '11 at 21:33
    
Good point. It doesn't, it's a bug in the plugin, see below for workaround. –  Brian Feb 3 '11 at 21:28

2 Answers 2

up vote 4 down vote accepted

I ended up having to manually detect the language, here's how I solved it:

<?php if (ICL_LANGUAGE_CODE == 'fr')
        {  
        // display the menu en francais 
            wp_nav_menu( array( 'menu' => 'Navigation principale', 'theme_location' => 'primary', 'container_class' => 'menu-header', 'menu_id' => 'menu-primary-navigation' ) );       
        } 
        else {  
        // show them the menu in English
            wp_nav_menu( array( 'menu' => 'Primary Navigation', 'theme_location' => 'primary', 'container_class' => 'menu-header', 'menu_id' => 'menu-primary-navigation' ) );
        }; ?>  
share|improve this answer

I don't know if this may help but it worked for me.

http://wpml.org/forums/topic/problems-with-menu-sync/

share|improve this answer
1  
Hi Armando. Great to have you join WPSE. I realize this is your first answer, but wanted to make you aware of a matter of protocol here. Link only answers are considered poor quality answers. If the external link is removed, your answer becomes benign. Please update your answer with more details of why/how this helped you. It's also good to post code snippets or quotes from the original article here with a citation to that article. Thanks! –  Brian Fegter Sep 16 '12 at 4:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.