Language Switcher
The language switcher is a UI element that lets visitors choose their preferred language. When a visitor clicks a language, they are taken to the translated version of the page they are currently viewing — the URL updates to the language prefix (e.g., /de/about/) and all text on that page is shown in the selected language.
Omnalingo provides several ways to add a switcher to your site, and you can use more than one at a time.
Floating Switcher Widget
Section titled “Floating Switcher Widget”The easiest option. Enable the floating switcher in Settings → Language Switcher and it appears as a fixed widget in the corner of every page on your site. Visitors can expand it to see the available languages and switch instantly.
No theme changes or shortcodes required — the widget is injected automatically via WordPress’s footer hook.
You can configure its position (bottom-left or bottom-right) and what it displays (flags, language names, or both) from the same settings screen.
Shortcode
Section titled “Shortcode”To place the switcher in a specific location — inside a page template, a text widget, or a custom block — use the shortcode:
[omnalingo-switcher]The shortcode renders the switcher inline wherever you place it. It works in:
- The WordPress block editor (add a Shortcode block)
- Classic text widgets
- Any theme template file that runs
do_shortcode() - Most page builder text elements
Navigation Menu Item
Section titled “Navigation Menu Item”You can add the language switcher directly to a WordPress navigation menu:
- Go to Appearance → Menus (or Appearance → Editor → Navigation in block themes).
- Add a Custom Link menu item with the URL
#omnalingo_switcherand any label you like. - Save the menu.
Omnalingo detects this placeholder URL and replaces the menu item with the rendered switcher widget when the page loads.
Alternatively, add individual language links to your menu using the URL placeholder #omnalingo_lang_{slug} (for example, #omnalingo_lang_de for German). Each placeholder is replaced with a direct link to the current page in that language.
Sidebar Widget
Section titled “Sidebar Widget”If your theme has widget areas (Classic themes):
- Go to Appearance → Widgets.
- Find the Omnalingo Language Switcher widget in the available widgets list.
- Drag it into the sidebar or footer widget area of your choice.
- Save.
The widget renders the switcher in that widget area on every page.
Display Options
Section titled “Display Options”All switcher methods share the same display settings, configurable under Settings → Language Switcher:
| Option | What it shows |
|---|---|
| Flags only | Country flag icons |
| Language names only | Full language name (e.g., “Deutsch”) |
| Flags and names | Both side by side |
| Abbreviations | Short language code (e.g., “DE”) |
The current active language is highlighted in the switcher so visitors can see which language they are already viewing.
Styling
Section titled “Styling”The switcher uses your theme’s existing styles for fonts, colors, and spacing where possible. For custom styling, target the .omnalingo-switcher CSS class. For example:
.omnalingo-switcher { font-size: 14px;}
.omnalingo-switcher a { color: #333;}Add custom CSS to Appearance → Customize → Additional CSS or your theme’s stylesheet.
Which Method Should I Use?
Section titled “Which Method Should I Use?”| Situation | Recommended method |
|---|---|
| You want the simplest setup | Floating widget |
| You want the switcher in your header | Navigation menu item |
| You want it in a specific page section | Shortcode |
| You want it in a sidebar or footer area | Widget |
You can combine methods — for example, use the navigation menu method in the header and the floating widget as a fallback for mobile visitors who scroll past the header.