-
Notifications
You must be signed in to change notification settings - Fork 3
Shortcodes
This page documents all the shortcodes registered by wpLingua.
File: inc/shortcode.php (registered in wplingua.php)
Description: Displays the wpLingua language switcher at the exact location where the shortcode is placed. This is the recommended way to insert the switcher when the automatic insertion option (wpLingua ➔ Switcher settings ➔ Insertion) is set to "None", for example inside a Gutenberg block-based theme (FSE), a classic theme template, or a page/theme builder like Divi or Elementor.
If a parameter is not specified, the value configured on the "Switcher settings" option page is used instead.
Attributes:
| Attribute | Accepted values | Description |
|---|---|---|
style |
list, block, dropdown
|
Layout of the languages in the switcher. |
flags |
circle, rectangular, wave, none
|
Shape of the flags, or none to hide them. |
title |
original, name, id, none
|
How the language names are displayed. |
theme |
light-double-smooth, light-double-square, light-simple-smooth, light-simple-square, grey-double-smooth, grey-double-square, grey-simple-smooth, grey-simple-square, dark-double-smooth, dark-double-square, dark-simple-smooth, dark-simple-square, blurblack-double-smooth, blurblack-double-square, blurblack-simple-smooth, blurblack-simple-square, blurwhite-double-smooth, blurwhite-double-square, blurwhite-simple-smooth, blurwhite-simple-square
|
Color theme and border style of the switcher. |
class |
any string | Additional CSS class(es) added to the switcher wrapper. |
insert |
bottom-right, bottom-center, bottom-left, none
|
Adds the corresponding insert-* CSS class to the switcher. Rarely needed with the shortcode, since the switcher is already placed exactly where you insert it. |
Usage example:
[wplng_switcher style="dropdown" theme="dark-simple-smooth"]
Full example with every parameter:
[wplng_switcher style="list|block|dropdown" flags="circle|rectangular|wave|none" title="original|name|id|none" class="your-css-class" theme="light-double-smooth|light-double-square|light-simple-smooth|light-simple-square|grey-double-smooth|grey-double-square|grey-simple-smooth|grey-simple-square|dark-double-smooth|dark-double-square|dark-simple-smooth|dark-simple-square|blurblack-double-smooth|blurblack-double-square|blurblack-simple-smooth|blurblack-simple-square|blurwhite-double-smooth|blurwhite-double-square|blurwhite-simple-smooth|blurwhite-simple-square"]
Related:
- wplng_switcher_html filter
- wplng_switcher_style, wplng_switcher_theme, wplng_switcher_name_format filters
- Toggle dropdown language switcher by click
File: inc/shortcode.php (registered in wplingua.php)
Description:
Wraps the enclosed content in a <span class="notranslate"> element. The .notranslate class is part of wpLingua's default excluded selectors, so any content wrapped with this shortcode is skipped by the translation engine and always displayed in its original language.
Usage example:
[wplng_notranslate]This text will never be translated.[/wplng_notranslate]
Related:
-
wplng_selector_exclude filter · the
.notranslateclass is part of the default excluded selectors list.
File: inc/shortcode.php (registered in wplingua.php)
Description:
Displays the enclosed content only when the current page language matches the language(s) specified in the lang attribute. Content that doesn't match the current language is stripped out entirely (not just hidden with CSS).
This shortcode is also documented with additional context and examples in Content by Language.
Attributes:
| Attribute | Accepted values | Description |
|---|---|---|
lang |
a language ID (e.g. en), a comma-separated list (e.g. en,fr), translated, or original
|
translated matches every target language; original matches only the website's source language. |
Usage example:
[wplng_only lang="en"]My content in English[/wplng_only]
[wplng_only lang="fr"]Mon contenu en français[/wplng_only]
[wplng_only lang="translated"]This content is shown in all the translated languages.[/wplng_only]
[wplng_only lang="original"]This content is shown only in the original language.[/wplng_only]
Related:
-
Content by Language · full walkthrough of this shortcode alongside the
wplng_intercepted_html/wplng_translated_htmlhooks.
wpLingua · wordpress.org/plugins/wplingua · wpLingua.com · Terms & Conditions
Reference
Classic uses
Recipes