Hi,
how can I sort flags inline in language switcher in the top menu? I want to display only flags, without language name.
Thanks,
regards!
If you look at Languages > Languageswitch Options you may rearrange the order of your activated languages. The order is stored in wp_options within icl_sitepress_settings (languages_order).
To point some things out:
Within config.php on line 248 the function avia_wpml_language_switch() renders the flag-stuff by calling icl_get_languages(). The ordering is currently hardcoded to ID. Maybe Kriesi should add a function to get the sorting from wp_options instead in a next update.
While messing around with things it is also quite easy to show the different language name with the flag – the span’s are currently set to display:none. I remember a support question about this (I think the thread is closed).
So if you add
.avia_wpml_language_switch li span.language_native {<br />
display: block;<br />
}
to the custom CSS field, the native title shows up (translated and code are the other classes). Another bit of float should be added to flag and text span, put some margins in and the text will display nicely. :)
Hey!
Yes, actually http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/ mentions another sort parameter and a function rewrite is not required.
You can try to replace following code in wp-contentthemesenfoldconfig-wpmlconfig.php:
$languages = icl_get_languages('skip_missing=0&orderby=id');
with
$languages = icl_get_languages('skip_missing=0&orderby=custom');
Best regards,
Peter