Created
April 29, 2019 11:18
-
-
Save ABooooo/6527888345acc0d31e61697d32fc4bda to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<div class="c-main-header__languageswitcher"> | |
<ul class="u-no-liststyle"> | |
<?php | |
$langs = array(); | |
$languages = icl_get_languages( 'skip_missing=0' ); | |
if( 1 < count( $languages ) ) { | |
foreach( $languages as $l ) { | |
$classes = ( $l['active'] == 1 ) ? 'is-active' : ''; | |
$langs[] = '<li class="' . $classes . '"><a href="' . $l['url'] . '">' . $l['code'] . '</a></li>'; | |
} | |
echo join(' ', $langs); | |
} | |
?> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment