Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #241220

    Hi guys,

    after installing the latest update Version 2.6.2, the WPML flags are showing up twice in my main menu.
    Here`s my site:

    #241574

    Hi ChrisiRa!

    Since 2.6.2 Enfold will add the flags to the main menu if WPML is activated and no top bar (secondary menu) is activated.
    You’ve two options:

    1) Go to WPML > Languages and deselect the ” Display the language switcher in the WP Menu” checkbox. This will deactivate the default menu language switcher.

    or

    2) If you don’t want to show the theme language switcher in the main menu insert this code into your child theme:

    
    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 );
    }
    

    Cheers!
    Peter

    #242974

    Hi, also can’t get rid of those flags; please see our site

    Wond Infographic Agency

    tried your instructions but they are still showing up??

    #243021

    Hi!

    Please add following code to Quick CSS in Enfold theme options under Styling tab

    .language_en, .language_es, .language_fr {
    display: none;
    }

    Regards,
    Yigit

    #243475

    Sorry but maybe I am being a novice but I didnt know I had a child theme and it doesnt say where to add the code to the child theme, can I please get a little more explicit instructions.

    #243783

    Hey!

    Thank you for using the theme! You can add Yigit’s code at the very bottom of the child theme’s style.css. Reload the page a few times to see the changes.

    Regards,
    Ismael

    #243788

    I think if you read the whole thread Yigit was suggesting I use this code

    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 );
    }

    This code doesnt look like CSS to me? but if I put it in style.css you think this will work?

    #243900

    Hey!

    You should add that code Peter posted inside Functions.php file if you don’t want to show the theme language switcher in the main menu

    Cheers!
    Yigit

    #243933

    So if I put this in functions.php I get a syntax error anc you please sned me the functions.php as you think it should be?

    #245042

    Hey!

    Please use the code I posted here: https://kriesi.at/support/topic/wpml-language-switcher-flags/#post-241574 and place it at the very bottom of the enfold/funcions.php file or into your child theme functions.php file.

    Regards,
    Peter

    #246204

    I think we must be at cross purposes I want to show the language changer as a drop down list in the menu, but it shows it as a list of flags, I have changed the code in functions as you suggested and http://www.preventon.com/home still shows a string of flags.. please can you advise…

    #246916

    Hey!

    The code should be working. Please create me an admin account and I’ll look into it. Alternatively you can modify wp-content/themes/enfold/config-wpml/config.php and delete:

    
            //first append search item to main menu
            add_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 );
            add_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 );
    

    Then the theme won’t append the flags to the menu.

    Regards,
    Peter

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