When using the WPML Multilingual Text Widget in the footer breaks the layout

The Multilingual Text widget is part of the String Translation WPML plugin. It has pretty much the same functionality as the built-in WordPress Text Widget, except that it allows you to choose the page’s language when it is shown.

If you’re using the Multilingual Text widget in the footer of our themes, where you can set the layout in the customizer, it will most probably break the layout of the footer because it doesn’t respect the settings you’ve set in the customizer.

Solution

The solution is to not use the Multilingual Text widget in the footer. Instead, use the regular (WP core) Text Widget together with the Widget Logic plugin.

An example of the Widget Logic code: ICL_LANGUAGE_CODE == 'en' for English or ICL_LANGUAGE_CODE == 'de' for German.

Explanation

The Widget Logic plugin hides the content in a different, less error-prone way than the Multilingual Text widget. Our PHP logic for the dynamic footer layouts doesn’t detect what the Multilingual Text widget does, so it doesn’t apply the layout in the right way. However, the logic works fine when using the Widget Logic plugin inside the Text Widget.