Hey,
I’d like to put WPML language switcher in the header, next to small twitter icon. None of the methods I’ve seen in forums worked.
Thanks.
Hi spadalbert!
Thank you for using Enfold.
Use this on functions.php to remove the default flag configurations:
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 this to render the default language switcher:
add_action('avia_meta_header', 'ava_icl_language_selector');
function ava_icl_language_selector(){
do_action('icl_language_selector');
}
Move the position of the switcher using css.
Regards,
Ismael
Thanks Ismael, I’ll try it.
Hi!
Great, please let us know if it doesn’t work for you.
Best regards,
Peter
Hi,
It actually doesn’t work. I inserted the code as said, but I don’t see any language menu next to social icons in header.
Best regards,
Hi!
Do you mind creating a temporary admin login and posting it here privately so we can look into it?
Regards,
Yigit
Hi!
Can you please switch user role to administrator so we can see plugin settings?
Cheers!
Yigit
Hey!
Looks like you didn’t activate the header meta. Please replace the code with this:
add_action('ava_main_header', 'ava_icl_language_selector');
function ava_icl_language_selector(){
do_action('icl_language_selector');
}
Regards,
Ismael