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

    Hi,

    I use WPML for a multi language site and I have a strange problem on a mobile with selecting a language.
    When I click on the language buttons nothing happens.See https://bergjeths.com on a mobile device. On a desktop it works fine.
    I use the following custom css code:

    /* WPML Flags Country Code */
    li.menu-item.menu-item-language.menu-item-language-current.dropdown_ul_available, #header_meta ul.avia_wpml_language_switch.avia_wpml_language_switch_extra,.language_flag img {display: none !important;}
    .header_color li.language_en.avia_current_lang span.language_code {text-decoration: underline; color: #ffffff !important;}
    .header_color li span.language_code {color: #ffffff !important; display: block !important; text-transform: uppercase; font-size: 16px; font-weight: normal; font-family: 'Exo', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;}
    #top ul.avia_wpml_language_switch li {margin: 0; padding: 0 5px; border: none; border-left: 1px solid #ffffff; height: 14px;}
    #top ul.avia_wpml_language_switch li:first-child {border-left: none;}
    #top ul.avia_wpml_language_switch li a {position: relative; top: -12px;}
    #top ul.avia_wpml_language_switch.avia_wpml_language_switch_extra {position: absolute; top: 82px;}
    #top .header-scrolled ul.avia_wpml_language_switch.avia_wpml_language_switch_extra {position: absolute; top: 15px;}
    .avia-menu.av-main-nav-wrap {margin-right: 130px;}
    
    /* WPML Flags Country Code */
    @media only screen and (max-width: 990px) {
    #header_main_alternate { display: block !important; border: none !important; }
    #top ul.avia_wpml_language_switch.avia_wpml_language_switch_extra {position: absolute; top: 0px;}
    } 

    and the following PHP code in function.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);
    }
    
    add_action('init', 'avf_add_flags');
    function avf_add_flags() {
    	add_action( 'ava_inside_main_menu', 'avia_wpml_language_switch', 10);
    }
    
    add_action('init','ava_remove_lang_flags', 9999);
    function ava_remove_lang_flags() {
    	remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 9998, 2 );
    	remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 9998, 2 );
            remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10);
            add_action('avia_after_footer_columns', 'avia_wpml_language_switch', 10);
    }

    I also use a widget area in the header with following code in functions.php:

    add_action( 'ava_after_main_menu', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
    	dynamic_sidebar( 'header' );
    }

    Can you help me out on this or point me in the right direction?
    THX Freek

    #986753

    Hey Freek,

    The widget is covering the language links. Please try to adjust the top padding of it:

    @media only screen and (max-width: 768px) {
    #header .widget {
        padding-top: 0;
    }
    }

    Best regards,
    Rikard

    #986852

    Hi Rikard,

    I used the recommended code and moved the language switcher to the center of the screen and now it is clickable.
    Thanks for the support!
    Freek

    #987053

    Hi Freek,

    Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #987150

    Case closed! THX Freek

    #987294

    Hi,

    Great, thanks for the feedback. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘`Strange WPML mobile behavior’ is closed to new replies.