Created
June 13, 2014 10:45
-
-
Save javierarques/baea44619d3292480ce7 to your computer and use it in GitHub Desktop.
WPML / Wordpress custom switch language menu adapted for Zurb Foundation 5 top bar menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( function_exists('icl_get_languages')):?> | |
<?php | |
$languages = icl_get_languages('skip_missing=N'); | |
$active = $languages[ICL_LANGUAGE_CODE]; | |
echo '<li class="has-dropdown"><a href="#">'. | |
'<i class="icon-'.ICL_LANGUAGE_CODE.' flag"></i>'. | |
'</a>'; | |
if(!empty($languages)){ | |
echo '<ul class="dropdown">'; | |
foreach($languages as $c => $l){ | |
if (! $l['active']) { | |
echo '<li><a href="'.$l['url'].'" class="text-center">'; | |
echo '<i class="flag icon-'.$c.'"></i>'; | |
echo '</a></li>'; | |
} | |
} | |
echo '</ul>'; | |
} | |
echo '</li>'; | |
?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment