Introduction

The WPML Language shortcode allows you to show specific content dependent on which language is selected for the site. This allows you to show different content to different users by the language that is set.

In order for this shortcode to work, you have to have the WPML WordPress plugin installed and activated.

WPML Language examples

The following shortcodes are coded so that they do not actually run, as WPML is not currently installed.
The following shortcode will show the alert shortcode only if the selected language is English.
[intense_wpml_language language=”en”]
[intense_alert color=”error” font_color=”#ffffff” border_radius=”5px” block=”1″]
This alert is shown only when the selected language is English.
[/intense_alert]
[/intense_wpml_language]
The following shortcode will show the alert shortcode only if the selected language is French.
[intense_wpml_language language=”fr”]
[intense_alert color=”error” font_color=”#ffffff” border_radius=”5px” block=”1″]
This alert is shown only when the selected language is French.
[/intense_alert]
[/intense_wpml_language]

Explore More Shortcodes

[intense_content_section]
<h2>Introduction</h2>
The WPML Language shortcode allows you to show specific content dependent on which language is selected for the site. This allows you to show different content to different users by the language that is set.

In order for this shortcode to work, you have to have the <a href="https://wpml.org/" rel="noopener" target="_blank">WPML WordPress plugin</a> installed and activated.
[/intense_content_section]
[intense_content_section background_type="color" background_color="#f9f9f9" border_top="1px solid #ededed" border_bottom="1px solid #ededed"]
<h2>WPML Language examples</h2>
[intense_row padding_top="0"]
[intense_column size="12" medium_size="12"]
The following shortcodes are coded so that they do not actually run, as WPML is not currently installed.
[/intense_column]
[/intense_row]
[intense_row padding_top="20"]
[intense_column size="6" medium_size="6"]
The following shortcode will show the alert shortcode only if the selected language is English.
[intense_spacer type="block" height="20"]
[intense_wpml_language language="en"]
[intense_alert color="error" font_color="#ffffff" border_radius="5px" block="1"]
This alert is shown only when the selected language is English.
[/intense_alert]
[/intense_wpml_language]
[/intense_column]
[intense_column size="6" medium_size="6"]
The following shortcode will show the alert shortcode only if the selected language is French.
[intense_spacer type="block" height="20"]
[intense_wpml_language language="fr"]
[intense_alert color="error" font_color="#ffffff" border_radius="5px" block="1"]
This alert is shown only when the selected language is French.
[/intense_alert]
[/intense_wpml_language]
[/intense_column]
[/intense_row]
[/intense_content_section]
[intense_snippet snippet_id="Child Theme | Shortcodes/footer" snippet_title="Shortcode Page Footer"]