Tagged: Language, language selector, wpml
Hello
I have installed both Enfold and WPML, but now I have some problem configuring the language selector.
As you seen the picture and the website below:
http://www.justinwestcapital.com/en/
There are two language selectors in header. I want to keep the left one which I know where to configure it. However, I can’t find anywhere to disable the selector on the rightmost language selector.
Can someone please advice?
Thanks
Hi leoncool!
Insert this code into your child theme functions.php file or enfold/functions.php:
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);
}
– it will remove the theme flags.
Regards,
Peter
i have a similar issue and i tried the code and it doesnt work.
i am using the header with the menu below, and i would like to remove the language switcher from the menu.
Your solution above does not work though.
Try this: comment the last line
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);
// add_action(‘ava_after_main_menu’, ‘avia_wpml_language_switch’, 10);
}
See the results:
http://www.justinwestcapital.com/en/
excellent thanks