I want to show the language selector on my site but with the default include code "icl_language_selector" it shows the language full name. I only want to show the abbreviations of the language. For example ...

English = ENG
French = FR

Is this possible and how can I pull this off?

closed as off-topic by Mark Kaplun, Pieter Goosen, cybmeta, Robert hue, TheDeadMedic Feb 25 '15 at 18:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.


I dealt with this writing a custom template tag. You may want to adjust the structure and classes in order to fit the needs of your styling:

function mysite_languages() {
  if ( function_exists( 'icl_get_languages' ) ) :
    $languages = icl_get_languages( 'skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str' );
    if ( ! empty( $languages ) ) :
      echo "\n<ul class=\"languages\">\n";
      foreach ( $languages as $lang ) :
        echo '<li class="' . ( $lang['active'] ? 'active' : ''  ) . '"><a href=' . $lang['url'] . '>' . $lang['language_code'] . "</a></li>\n";
      echo "</ul>\n";
    endif; // ( ! empty( $languages ) )
  endif; // ( function exists )

Further reference on WPML page: http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/

Not the answer you're looking for? Browse other questions tagged or ask your own question.