New Landing How can we help? Atelier Language flags side by side

Viewing 11 posts - 1 through 11 (of 11 total)
  • Posted in: Atelier
  • #237799
    macarri80
    Member
    Post count: 15

    Hi,

    my website is in Italian and English. I would like that the flags were visible (and clickable) side by side like on attached screenshot, without the drop-down menu.

    Please let me know if this is possible, thanks

    Attachments:
    You must be logged in to view attached files.
    #237807
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please refer this article https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/. Hope it should help to you.
    Thanks
    Mohammad

    #237810
    macarri80
    Member
    Post count: 15

    Thanks, but the options on that page seem that not affect the layout of the language switcher on the header of the Atelier theme, the one that is active on my site.

    #237854
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme:-

    function sf_language_flags($items,$args) {
        
        if (function_exists('icl_get_languages') && $args->theme_location != '') {
            $languages = icl_get_languages('skip_missing=0');
                
            if(1 < count($languages)){
               
                foreach($languages as $l){
                        $items = $items.'<li class="menu-item menu-lang-icon lang-'.$l['language_code'].'"><a href="'.$l['url'].'" class="dropdown-toggle" data-toggle="dropdown"><img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" /></a></li>';
                }
            }
        }
            
        return $items;
    }

    Thanks
    Mohammad

    #237912
    macarri80
    Member
    Post count: 15

    Thanks Mohammed,

    I’ve pasted the code but instead of the flags appears the word “lingua” and nothing happens clicking on it.

    I’ll provide ftp and admin access so that you can check. The code is commented in functions.php under the child theme folder.

    #237913
    macarri80
    Member
    Post count: 15
    This reply has been marked as private.
    #238099
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have managed to resolve the issue through given below css code:-

    .header-right .aux-item{
    vertical-align:middle !important;
    }
    
    ul.header-languages{
    display:block !important;    
    position:relative !important;
    }
    
    ul.header-languages li{
    float:left !important;
    }
    
    span.language{
    display:none !important;
    }
    .aux-languages > a{
    display:none !important;
    }
    

    Thanks
    Mohammad

    #238163
    macarri80
    Member
    Post count: 15

    Sorry, I’ve pasted the css code but nothing happens, the flags are not visible.

    The php and css code is now active on the website, so that you can check.

    Thanks again

    #238291
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have resolved the issue so please check after clear the cache of browser.
    Thanks
    Mohammad

    #238334
    macarri80
    Member
    Post count: 15

    Now it’s perfect, thank you.

    #238344
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome and glad to help you.
    Thanks
    Mohammad

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register