Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 67836

Output the name of the language

$
0
0

Replies: 0

Hi! There are custom code that the withdrawal of languages, but I still need to get the name of languages. Tell me how to do.

<?php } ?>
                            <?php
							if(function_exists('icl_get_languages')){
								$arr_lg = icl_get_languages('skip_missing=0');
								if(!empty($arr_lg)){ ?>
                                <ul class="wmpl-lang nav navbar-nav navbar-right" >
                                    <li class="main-menu-item menu-item-depth-0 menu-item menu-item-has-children parent dropdown sub-menu-left">
                                    <?php
                                    $lang_html = '';
                                    foreach($arr_lg as $item){
                                        if (in_array($item['language_code'], array('',))) continue;
                                        if($item['active']){
                                            echo '<a href="'.esc_url($item['url']).'"><img title="'.esc_attr($item['translated_name']).'" src="'.esc_url($item['country_flag_url']).'"/></a>';
                                        }
                                        $lang_html .= '<li class=""><a title="'.esc_attr($item['translated_name']).'" href="'.esc_url($item['url']).'"><img title="'.esc_attr($item['translated_name']).'" src="'.esc_url($item['country_flag_url']).'"/></a></li>';
                                    }

                                    if($lang_html){
                                        echo '<ul class="dropdown-menu menu-depth-1">'.$lang_html.'</ul>';
                                    }
                                    ?>

                                    </li>
                                </ul>

                                <?php
								}
							}
							?>

Viewing all articles
Browse latest Browse all 67836

Trending Articles