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
| <?php | |
| /* | |
| * WPML language switcher customizations: htp://wpml.org | |
| */ | |
| function custom_wpml_lang_switcher() { | |
| if (function_exists('icl_get_languages')){ | |
| // remove WPML default css | |
| define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true); | |
| // Custom language layout selector ?> | |
| <div class="languages"> | |
| <ul> | |
| <?php | |
| $languages = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str'); | |
| foreach($languages as $language){ | |
| //$flag = $language['country_flag_url']; | |
| $url = $language['url']; | |
| $isActive = $language['active']; | |
| $name = $language['native_name'] | |
| ?> | |
| <li> | |
| <a class="<?php if($isActive == 1){ ?> class="active" <?php } ?>" href="<?php echo $url; ?>"> | |
| <?php echo $name; ?> | |
| </a> | |
| </li> | |
| <?php } ?> | |
| </ul> | |
| <?php } | |
| } |

Deja un comentario