Adding A Language Switcher

Many language plugins include built-in options for adding your language switcher directly to your WordPress menu, but often this doesn’t look very good it really clutters things up. For this reason we have included built-in shortcodes for WPML and Polylang switchers.

WPML Shortcode

WPML includes a built-in shortcode for displaying a language switcher anywhere you want that uses the “Custom Language Switchers” settings in the main WPML settings panel. This shortcode doesn’t include any parameters so be sure to go to your WPML admin panel to customize the way you want it to look after adding it where you want (displays as a “list” by default). You can view all WPML shortcodes and parameters on their docs here.

[wpml_language_selector_widget]

PolyLang Shortcode

Total includes a PolyLang lanaguage switcher so you can add it wherever you want!

[polylang_switcher]

Parameters:

  • dropdown – true or false
  • show_flags – true or false
  • show_names – true or false
  • classes – add unique classes to your language switcher

Adding It To The Topbar

The Topbar is probably one of the best places to add a language switcher (besides maybe the footer widgets, which I think is also a great location). Adding it to the topbar is super easy. Simply go to Appearance / Customize / Topbar and add the shortcode into the “Content” textarea¬†under the General section.