This tutorial shows you how to display different content for English language readers and othr content for other languages.
You can use the first 2 code snippets for any country supported by the WPML plugin:
There’s 4 code snippets which display different types of content in this post.
- The 1st code snippet assumes the use of the Soliloquy slider and the WPML language plugin as its checks that both are installed and active.
- The 2nd code snippet includes an example for displaying a different widget and also assumes the use of the WPML language plugin which it checks for. It displays different widgets for French & English.
- The 3rd solution doesn’t require the use of a translation plugin however it does check for translated content.
- The 4th solution assumes the use of the qtranslate plugin.
Swap out the country codes to suit your own requirements.
Here’s the code for logged in members: