Tagged: wpml language switcher
-
AuthorPosts
-
March 19, 2025 at 4:10 am #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,
ChristopherMarch 20, 2025 at 1:39 am #1479759Hey 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,
IsmaelMarch 20, 2025 at 4:52 am #1479768The Flag are still there
-
This reply was modified 7 months, 1 week ago by
Christopher.
March 21, 2025 at 3:56 am #1479821Hi,
We added the css again. Please make sure to purge the cache before testing.
Best regards,
IsmaelMarch 21, 2025 at 8:33 am #1479842Hi Ismael,
thank you very much. That worked!
Best regards,
CristopherMarch 21, 2025 at 4:10 pm #1479871Hi,
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 -
This reply was modified 7 months, 1 week ago by
-
AuthorPosts
- The topic ‘Hide default WPML language switcher’ is closed to new replies.
