WP Residence Help WP Residence Help

  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / 30. WPResidence Translate Plugin / The WPResidence Language Switcher Widget

The WPResidence Language Switcher Widget

2 views 0

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.

Screenshot: Frontend language switcher dropdown open showing flags and language names

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:

  1. If a translation of the current page/post exists in the target language, jump to that translation.
  2. If the current view is a taxonomy archive and the term has a translation, jump to the translated term archive.
  3. If the current page is the front page, jump to the language root URL.
  4. 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.

Screenshot: Widgets screen with WPResidence Language Switcher dropped into the sidebar widget area

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.
30. WPResidence Translate Plugin

Related Articles

  • String Scanner — Developer Guide
  • The String Scanner
  • Gettext Pipeline & MO Files — Developer Guide
  • Gettext & MO Files — Making Translations Appear on the Front End

WP Residence Documentation

  • 01. Getting Started
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 02. Installation & Setup
  • 03. Installation FAQ
  • 06. Search & Filtering
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 09. Agent, Agency & Developers
  • 08. Property Pages & Layouts
  • 07. Property Lists, Categories & Archive
  • 13. WPResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • 04. Theme Options & Global Settings
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • 20. Translations & Languages
  • 26. FAQ
  • 10. Pages
  • 11. Header
  • 12. Footer
  • 05. Maps & Location Settings
  • 18. Payments & Monetization
  • Plugins
    • 19. Included Plugins
    • 22. Third Party Plugins – IDX Compatibility
    • 21. Third-Party Plugins – Multi-Language
    • 23. Third party Plugins – Other
  • Technical
    • 24. Technical how to | Custom Code Required
    • 25. Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API