Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1479687

    Hello,

    I am trying to disable the standard language flags in the Header Top Bar (frontend).
    I managed to hide them via css at first, but they appeard again, after activating a flag in the main menu list.

    I only want a flag to appear under the last menu item not in the top bar.

    The problem appears only on the german version of the site.
    I have tried varios solutions (CSS and PHP) i found in your forum but without success.
    I contacted WMPL support but they have been unable to help, because it seems to be part of Enfold.

    Tried this in functions.php:

    //————————————————————–
    // Remove Enfold Language Switcher
    //————————————————————–
    function avia_remove_main_menu_flags(){
    global $avia_WPML;

    add_filter( ‘wp_nav_menu_items’, ‘avia_append_lang_flags’, 9999, 2 );
    remove_filter( ‘wp_nav_menu_items’, [ ‘avia_WPML’, ‘handler_append_lang_flags’ ], 9998, 2 );
    remove_filter( ‘avf_fallback_menu_items’, [ ‘avia_WPML’, ‘handler_append_lang_flags’ ], 9998, 2 );
    remove_action( ‘avia_meta_header’, ‘avia_wpml_language_switch’, 10 );
    remove_action( ‘ava_main_header_sidebar’, ‘avia_wpml_language_switch’, 10 );
    }
    add_action(‘init’,’avia_remove_main_menu_flags’, 9999);

    Best regards,
    Christopher

    #1479759

    Hey Christopher,

    Thank you for the inquiry.

    We added this code in the Quick CSS field to hide the extra language switcher in the main header.

    #header_main .avia_wpml_language_switch {
        display: none;
    }

    Please make sure to purge the cache before testing.

    Best regards,
    Ismael

    #1479768

    The Flag are still there

    • This reply was modified 3 weeks, 6 days ago by Christopher.
    #1479821

    Hi,

    We added the css again. Please make sure to purge the cache before testing.

    View post on imgur.com

    Best regards,
    Ismael

    #1479842

    Hi Ismael,

    thank you very much. That worked!

    Best regards,
    Cristopher

    #1479871

    Hi,
    Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Hide default WPML language switcher’ is closed to new replies.