Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #265852

    Hi there
    I installed “WPML multilangual cms” and “WPML translation management”. Latest enfold, wp, WPML

    Still I have the problem with the language switcher in wp menu. As soon as I change to the second language, which is “french”, I get the french page, but the language switcher is not longer shown in the wp menu. You can see that, if you go to:

    1. http://www.avcare.ch/willkommen
    2. You will see the switcher in wp menu, right side, german
    3. choose language “francais”
    4. You will see the french translated site (words are not translated yet, but you’ll see it in the breadcrump)
    5. And you will see that the switcher in wp menu is disappeared

    What is the problem? Don’t think it’s a WPML problem. To change WPML > Languages > Language switcher options > “How to handle languages without translation” and select the “Link to home of language for missing translations” option has no effect!

    #265867

    Hey baiker!

    Yes, the theme language switcher is hidden if no translated entry exists. If you really want to use the option you mentioned above you need to use the default WPML language switcher and need to deactivate the theme language switcher.

    1) insert this code into your child theme functions.php file to deactivate the theme flags/language switcher:

    
    add_action('after_setup_theme','avia_remove_main_menu_flags');
    function avia_remove_main_menu_flags(){
            remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 );
            remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 );
            remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10);
    }
    

    2) Go to WPML > Languages and tick the “Display the language switcher in the WP Menu” option.

    Regards,
    Peter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.