New Landing How can we help? Themeforest Theme Support Dante Multilingual plugin recommended

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #237812
    newki
    Member
    Post count: 177

    Hello,

    I’d like to add multilingual flags in the top bar. In the past (on the another wbesite), I remembered having issues to display the flags horizontally in the top bar.
    Is it the plugin adapted to your theme or do you suggest using another plugin (if yes, which one)
    Thanks for your help,
    Have a nice day

    #237855
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You can use WPML plugin and 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

    #237859
    newki
    Member
    Post count: 177

    Thanks Mohammad, I’ll try this.
    Happy 2016 !

    #237860
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Try this and let me know your feedback.
    Thanks
    Mohammad

Viewing 4 posts - 1 through 4 (of 4 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