-
AuthorPosts
-
June 15, 2016 at 4:04 am #648343
Hello,
I have a problem with the WPML language switcher.
I have tried every thread posted here on Kriesi.at to Display the language switcher as a dropdown but nothing helped.
1. https://kriesi.at/support/topic/enfold-heading-with-wpml/ not works for me
2. https://kriesi.at/support/topic/wpml-language-switcher-3/ not works for me
3. https://kriesi.at/support/topic/remove-language-switcher-flags-in-header/ not works for meThe dropdown does not show up . Can you help me?
Thanks a lot in advance!
June 15, 2016 at 5:05 am #648367First, I have to remove the theme’s default flag configuration with this on 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);
}
Use this again on functions.php file to add the WPML language selector:add_action(‘avia_meta_header’, ‘ava_icl_language_selector’);
function ava_icl_language_selector(){
do_action(‘icl_language_selector’);
}after /wp-content/themes/enfold-child/includes/helper-main-menu.php
do_action(‘avia_meta_header’);
with:do_action(‘icl_language_selector’);
I see the dropdown box but it’s not clickable also there is only one language showing up there
June 15, 2016 at 6:23 am #648402Hi!
Thank you for using Enfold.
Could you please provide a link to the page? Adding the code to remove the default flag switcher and enabling the drop down switcher should be enough. You don’t need to modify the helper-main-menu.php file.
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('avia_meta_header', 'add_custom_content_to_header'); function add_custom_content_to_header() { do_action('icl_language_selector'); }
Best regards,
IsmaelJune 15, 2016 at 7:02 am #648427Hi Ismael,
I’ve added the the code you mention above, same problem please check a Private Content.
Thanks
June 17, 2016 at 6:24 am #649584Hi,
Did you set the WPML > Language switcher ? Language switcher style option dropdown?
Best regards,
IsmaelJune 18, 2016 at 4:39 am #650074Correct, that I exactly did, not works
June 20, 2016 at 5:34 am #650595Hi,
Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.
Thanks,
RikardSeptember 2, 2016 at 11:18 am #681223Same problem on my Site. I tried to display the dropdown but it does not show up. This topic exists for over two years now. Why is it still not fixed?
I have tried to select dropdown and other opportunities but nothing worked out for me. Can you help me?September 3, 2016 at 8:54 am #681588Hi,
This topic was started in june of this year for the record. Could you post a link to your site and try to explain your problem a bit further please?
Thanks,
RikardSeptember 5, 2016 at 2:18 pm #682165Hi Rikard,
there are a few topics with the same problem which started two years ago. But the other solutions where just CSS solutions. Thats why I’m asking why you don’t fix in an update? I can’t attach images. I want to change the style for my WPML from a simple Flag (displayed in a row next to each other) to a dropdown with a Flag an a name to save space in my top menu. The Menu is displayed in the normal menu.
<li class=”av-language-switch-item language_de avia_current_lang current-menu-item”><span class=”language_flag”></span>
How can I change it into a dropdown Menu?
September 8, 2016 at 4:12 am #683456Hi,
Did you try the solution above? The code should remove the default flag styling of the theme and then add the default WPML language switcher in the top bar. https://kriesi.at/support/topic/wpml-language-switcher-as-dropdown-list/#post-648402
Related links:
https://kriesi.at/support/topic/how-to-change-position-of-wpml-langs-on-the-right-of-my-secondary-menu/
https://kriesi.at/support/topic/language-switcher-3/Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.