Docs
Language menu
Place a language menu as a block, a shortcode, a menu item, a floating button, or in your theme.
The language menu is one set of links, shown a few different ways depending on the theme. Whichever way you place it, it offers the same languages, in the same order. There is one answer to “what does the menu look like?”
Defaults
Set these once on the Visitors tab under LocalePro → Settings. A preview sits beside the controls, so you can see the result before you save.
- Layout. A list of links, a dropdown, or a compact select menu. The dropdown and the select start as real links, then a small script turns them into the interactive version. A visitor without JavaScript, and a search engine, still get every language.
- Names. In their own language (“Español”), in English (“Spanish”), both (“Español (Spanish)”), or by code (“ES”).
- Hide the current language. Off by default. Some designs only want to show the languages a visitor could switch to.
Any placement below can override these for itself. You can show flags too.
Ways to place it
Block. Insert the Language Switcher block in the editor or the site editor.
Shortcode. [localeready_switcher] anywhere a shortcode runs: a post, a widget area, a page builder’s shortcode. Override one placement with attributes: [localeready_switcher layout="dropdown" labels="both" hide_current="true"].
Menu. Under Appearance → Menus, add Language Switcher like any other item. This is for classic menus.
Floating button. Turn it on from the Visitors tab and it sits on the corner of the page.
Theme. <?php localeready_switcher(); ?> in a PHP template, for a classic theme’s header or footer.
What it doesn’t show
The menu renders nothing when only one language applies: a page an exclusion hides it on, or a site with only one language turned on. A language that would lead nowhere for this page (because a rule excludes it, or a page setting turns it off) is left out, rather than shown as a dead link.
Follow the browser, once
Also on the Visitors tab: send a first-time visitor to the language their browser is asking for. Someone who has already picked a language, or who arrived on a language’s own address, is never moved again. Search engines are never redirected.
A menu of your own
If you need something the built-in placements don’t offer, localeready_get_language_links() returns the same links, without the wrapping markup. See template tags.