Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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 me

    The dropdown does not show up . Can you help me?

    Thanks a lot in advance!

    #648367

    First, 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

    #648402

    Hi!

    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,
    Ismael

    #648427

    Hi Ismael,

    I’ve added the the code you mention above, same problem please check a Private Content.

    Thanks

    #649584

    Hi,

    Did you set the WPML > Language switcher ? Language switcher style option dropdown?

    Best regards,
    Ismael

    #650074

    Correct, that I exactly did, not works

    #650595

    Hi,

    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,
    Rikard

    #681223

    Same 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?

    #681588

    Hi,

    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,
    Rikard

    #682165

    Hi 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?

    #683456
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.