Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #678252

    Hello,

    In WPML options I have set the option “skip language”, so if a page/post is not translated the flag of the missing language will not appear in the language switcher.

    This works very well in the WPML language switcher but not in the Enfold language switcher : whatever the available translations, all languages flags are displayed. If a page has no translation, the user is redirected to the home page, which is not very user-friendly.

    If there a way to have the Enfold language switcher behave like the standard WPML one ?

    Thanks,
    Bérangère

    • This topic was modified 7 years, 10 months ago by caudebert.
    #679839

    Hey,

    Have you tried disabling the Enfold flags and using the ones from WPML?

    Best regards,
    Josue

    #679900

    Hi Josue,

    I could do so but there is no option to disable the Enfold switcher.

    I could of course hide them vis css but this is not my preferred option.

    Would you have a filter in functions.php to hide the Enfold switcher in the menu and the top bar ?

    Regards,

    Bérangère

    • This reply was modified 7 years, 9 months ago by caudebert.
    #680132

    Hi,

    Yes, use this code:

    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);
    }

    Best regards,
    Josue

    #682703

    Thanks a lot Josue, it works like a charm.
    Best regards
    Bérangère

    #682752

    Hi,

    Glad to hear that it works. Feel free to reach out to us again if you have any other questions :)

    Best regards,
    Jordan

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Enfold WPML language switcher : hide unavailable languages ?’ is closed to new replies.