Created
January 2, 2014 21:44
-
-
Save jameslutley/8227505 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
| // Disable Included CSS Files | |
| define ( 'ICL_DONT_LOAD_NAVIGATION_CSS', true ); | |
| define ( 'ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true ); | |
| define ( 'ICL_DONT_LOAD_LANGUAGES_JS', 'true'); | |
| function catBuild_WPML_languageSwitcher() { | |
| if (function_exists('icl_get_languages')) { | |
| $existing_languages = icl_get_languages('skip_missing=0'); | |
| foreach($existing_languages as $lang) { | |
| if ($lang['active']) { | |
| printf(' | |
| <li class="languageSelector %s dropdown"> | |
| <a class="dropdownToggle" href="%s">%s | |
| <span class="flag"> | |
| <img src="%s" alt="%s"> | |
| </span> | |
| <span class="dropdownArrow"></span> | |
| </a> | |
| ', | |
| $lang['language_code'], | |
| $lang['url'], | |
| $lang['native_name'], | |
| $lang['country_flag_url'], | |
| $lang['native_name'] | |
| ); | |
| break; | |
| } | |
| } | |
| foreach($existing_languages as $lang) { | |
| if (!$lang['active']) { | |
| printf(' | |
| <ul class="subMenuDropdown"> | |
| <li class="%s"> | |
| <a href="%s">%s | |
| <span class="flag"> | |
| <img src="%s" alt="%s"> | |
| </span> | |
| </a> | |
| </li> | |
| ', | |
| $lang['language_code'], | |
| $lang['url'], | |
| $lang['native_name'], | |
| $lang['country_flag_url'], | |
| $lang['native_name'] | |
| ); | |
| } | |
| } | |
| printf('</ul></li>'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment