1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function language_flags(){
		if (function_exists('icl_get_languages')) {
		    $languages = icl_get_languages('skip_missing=0&orderby=code');
		    if(!empty($languages)){
		        echo '<ul id="header-language-flags" class="clearfix">';
		        foreach($languages as $l){
		            echo '<li>';
		            if($l['country_flag_url']){
		                if(!$l['active']) {
		                	echo '<a href="'.$l['url'].'">$l['translated_name']</a>';
		                } else {
		                	echo '<div class="current-language">$l['translated_name']</div>';
		                }
		            }
		            echo '</li>';
		        }
		        echo '</ul>';
		    }
	    } else {
	    	echo "<p>WPML not installed and activated.</p>";
	    }
	}