Tagged: wpml language selector
Hi,
I tried the following code to my child’s theme function.php file, but it won’t disable the default language switcher after the search icon?
add_action('after_setup_theme','avia_remove_main_menu_flags');
function avia_remove_main_menu_flags(){
remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 );
remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 );
remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10);
}
Any idea on how to resolve this, now i have two language selectors?!
Thanks,
Patrick
Hey vanwoods,
Try this code instead and let me know if it works:
add_action('init','ava_remove_lang_flags', 9999);
function ava_remove_lang_flags() {
remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 9998, 2 );
remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 9998, 2 );
remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10);
add_action('avia_after_footer_columns', 'avia_wpml_language_switch', 10);
}
Best regards,
Jordan
Hi Jordan,
Thanks for the solution this works fine! However what do i need to add to this code so that it will hide the WPML menu in de footer and widgets area also?!
Thanks,
vanWoods
Hi,
Please try the following in Quick CSS under Enfold->General Styling:
#socket .menu-item-language {
display:none;
}
Best regards,
Rikard
Hi Rikard,
Thanks for the quick reply!
I added “important” and the extra class for the widget switcher. Now it works as the client needs it.
#socket .menu-item-language, .avia_wpml_language_switch_extra {
display:none !important;
}
Regards,
vanWoods