Add a selector with a shortcode

The shortcode places a selector in any public area that executes WordPress shortcodes.

Start with:

[pom_translate_language_switcher]

It uses the saved Shortcodes format and Shortcodes markup settings.

Configure the saved defaults

  1. Open Settings → POM Translate → Language switcher.
  2. Under Shortcodes, choose List, Links, or Dropdown.
  3. Set Shortcodes markup.
  4. Save the settings.
  5. Insert the shortcode into a shortcode block, widget, builder module, or other supported area.

Override one instance

Use attributes when one placement needs different output:

[pom_translate_language_switcher format="dropdown" markup="{%local_label%}" container_class="header-languages" button_class="header-languages__button"]

You can also control whether the base and current languages appear:

[pom_translate_language_switcher include_base_language="false" include_current_language="true"]

An empty include_current_language value follows the global Hide current language setting. An explicit valid Boolean overrides it for that shortcode only.

Verify the embedding surface

  1. Confirm the shortcode is rendered rather than printed as text.
  2. Check its placement before and after content filters run.
  3. Test every offered destination.
  4. For dropdown format, operate the toggle by mouse and keyboard.
  5. Check that custom CSS classes coexist with POM Translate's required base classes.
  6. Test a page where one locale is excluded.

The shortcode returns an empty string when filtering leaves no language entry to render.

See Shortcode reference for the complete attribute contract.