The WPResidence Language Switcher is a Bootstrap-style dropdown that lets visitors pick the language they want to view your site in. It respects the language order and flags you configured on the Languages screen, follows translated content when a translation exists, and falls back gracefully when it does not. This article covers how to add the switcher, configure it, and place it where it makes the most sense on a multi-language real estate website.
Where to Find the Widget
In WordPress admin open Appearance > Widgets. The widget is listed as WPResidence Language Switcher. Drag it into any widget area — sidebar, footer column, or a registered header widget area — and save.
Widget Settings
The widget has a single setting:
| Field | Purpose |
|---|---|
| Title | Optional heading shown above the dropdown. Leave empty for a bare switcher with no label. |
Everything else — languages listed, flags shown, display order — is read automatically from the plugin’s Languages screen. You do not configure it twice.
When the Widget Appears
The switcher only renders when at least two active languages are configured. Before you add a second language, the widget draws nothing on the frontend. This prevents a useless one-item dropdown.
What Each Entry Points To
When a visitor clicks a language in the dropdown, the widget chooses the best destination URL for that language:
- If a translation of the current page/post exists in the target language, jump to that translation.
- If the current view is a taxonomy archive and the term has a translation, jump to the translated term archive.
- If the current page is the front page, jump to the language root URL.
- Otherwise, jump to the language root URL (home page in that language).
This behavior keeps visitors on comparable content instead of dropping them on the homepage every time they switch.
Flags
Flags come from the plugin’s built-in SVG flag library at assets/img/flags/4x3/. The flag shown next to each language is the one you selected on the Languages screen. If a language has no flag configured, its entry shows text only without breaking the layout.
Placement Patterns
- Header — the most common spot. If your theme registers a header widget area, drop it there for maximum visibility.
- Footer column — good secondary placement for visitors who scroll to the bottom to look for language options.
- Sidebar — appropriate for blog-heavy sites where articles live in a two-column layout.
- Navigation menu — the plugin can inject the switcher into the WPResidence and WPRentals navigation menus automatically when configured; the widget version above is the manual alternative for any other location.
Cookie Behavior
When a visitor chooses a language, the widget stores that preference in a cookie so subsequent visits open in the same language. The cookie is only set when the click lands the visitor on a genuine translation (not a fallback), avoiding sticky mismatches where someone gets trapped in a language without translated content.
Accessibility
The dropdown uses a button with aria-expanded, a screen-reader-only “Select language” label, and alt text on every flag image (for example French flag). Keyboard focus states follow the Bootstrap dropdown pattern your theme already styles.
Multiple Instances
You can drop the widget into more than one widget area. Each instance keeps its own title and uses a unique wrapper ID, so multiple switchers on the same page do not interfere with each other.
Non-Latin Languages
Language names display exactly as typed on the Languages screen. Chinese, Arabic, Cyrillic, and Greek names render correctly without extra configuration.
Troubleshooting
- Widget does not appear: confirm at least two languages are both Enabled and Visible on the Languages screen.
- Flag is missing: the language’s flag field is empty or points to an ISO code without an SVG in the plugin’s flag folder.
- Switcher jumps to the home page instead of a translated post: that post does not have a translation in the target language yet. Create one from the post editor.
For a broader guide on multilingual real estate site architecture, see our multi-language real estate website page.
What To Read Next
- Managing Languages — the upstream setup the widget reads from.
- Admin Bar Language Switcher & Editor Header Selector — the admin-side counterparts.
- Menu Translation & Language-Specific Menu Locations — place a switcher directly inside a nav menu.