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