'WPML: ICL_LANGUAGE_CODE and wpml_current_language returns always language code de

i'm using WPML for translations on the wordpress website. Now i want to get the current language code, to redirect to the right site.

I've founded for that two ways: Using the ICL_LANGUAGE_CODE or the filter-function wpml_current_language. The thing is, that both ways returns always the language code de. Also, if i change the language to english with the language switcher.

Do anyone have an idea how i can get the current language code?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source