Tagged: wpml language switcher
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
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
The Flag are still there
Hi,
We added the css again. Please make sure to purge the cache before testing.
Best regards,
Ismael
Hi Ismael,
thank you very much. That worked!
Best regards,
Cristopher
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