Hi
I use WPML and the language switcher is text only. My html source code loads three flags I don’t use from ../wp-content/plugins/sitepress-multilingual-cms/res/flags/xx.png. Whats the proper way to get rid of them in the html code?
Thanks, Filz
Hey filz51,
Thank you for the inquiry.
You are probably looking on the default language switcher from the theme. To remove or disable those flags, please go to the Enfold > Header > Extra Elements and set the Enfold WPML Language Flags ( global setting – used for all languages ) to the second option.
You can also try this snippet in the functions.php file.
//--------------------------------------------------------------
// 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,
Ismael
Hi Ismael
Thank you. Excellent support.
Happy Tuesday
Filz