Categories

Featured templates

WordPress. How to display different widgets per language (based on WPML plugin)

Judy Waters April 6, 2016
Rating: 5.0/5. From 3 votes.
Please wait...

This tutorial shows you how to display different widgets per language (based on WPML plugin).

WordPress. How to display different widgets per language (based on WPML plugin)

WPML plugin allows translating text and titles, though you are not allowed using different content of the widgets with its help. Therefore, additional plugin is used for this matter. It is not included in the template’s default package. Please download Widget Logic plugin from WordPress official page.

  1. Next, open Dashboard> Plugins> Add New> Upload and install package for this plugin. Make sure to activate it once installation is completed.

  2. Now navigate to Appearance> Widgets section of the Dashboard to assign different widgets for the installed languages.

  3. Select required widget type and insert it to the widget area. Once you are done with widget content, specify the language it will be used for. Use the following code constant for language definitionunder ‘Widget Logic’ tab:

    ICL_LANGUAGE_CODE == 'XX'

    where ‘XX’ symbol should be replaced with the language specification, for example: ‘de’ for German, ‘en’ for English, ‘fr’ for French, etc. This condition tells Widget Code to display this widget only on the pages for selected language:

    WordPress_How_to_display_different_widgets_per_language_based_on_WPML_plugin_1
  4. Repeat the same steps for the second language installed. Make sure to use different language specification under ‘Widget Logic’ tab for it.

Save changes for widgets and get back to the website. You should get different widgets appearing per different languages now.

Feel free to check the detailed video tutorial below:

WordPress. How to display different widgets per language (based on WPML plugin)
Best Wordpress Themes
This entry was posted in WordPress Tutorials and tagged different, page, plugin, widget, WordPress, WPML. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket