Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #276173

    Hello

    I have installed both Enfold and WPML, but now I have some problem configuring the language selector.

    As you seen the picture and the website below:
    problem
    http://www.justinwestcapital.com/en/

    There are two language selectors in header. I want to keep the left one which I know where to configure it. However, I can’t find anywhere to disable the selector on the rightmost language selector.

    Can someone please advice?

    Thanks

    #276209

    Hi leoncool!

    Insert this code into your child theme functions.php file or enfold/functions.php:

    
    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);
            add_action('ava_after_main_menu', 'avia_wpml_language_switch', 10);
    }
    

    - it will remove the theme flags.

    Regards,
    Peter

    #286188

    i have a similar issue and i tried the code and it doesnt work.
    i am using the header with the menu below, and i would like to remove the language switcher from the menu.

    Your solution above does not work though.

    #286192

    Try this: comment the last line

    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);
    // add_action(‘ava_after_main_menu’, ‘avia_wpml_language_switch’, 10);
    }

    See the results:

    http://www.justinwestcapital.com/en/

    #286195

    excellent thanks

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘How to disable the WPML language selector in the menu after search icon?’ is closed to new replies.