

Now, the width of the list items is improved, as displayed in the following image. There is no need to edit your theme’s CSS file, simply add custom rules to the Additional CSS section under the Language switcher options. You can easily fix this by using the wpml-ls-menu-item CSS class. Flags-only language switcher with Twenty Sixteen theme As you can see in the following image, the width of the menu items is oddly large. This simplifies the customization of your menu switcher items (links).įor example, if your site uses the Twenty Sixteen theme and your menu switcher displays only the languages’ flags, the front-end rendering will be odd. Specifically for menu language switchers, WPML uses the CSS class wpml-ls-menu-item. Menu language switcher on the front-end Customizing Menu Language Switchers This way, your theme renders the language switcher just like other menu items.īasically, this allows the language switcher to look better on your site, taking on the look of your theme’s CSS rules. Instead, it injects the language switcher elements into the menu structure. WPML does not render language switchers with its own HTML. HTML Structure of Menu Language Switchers However, it does show you the effect of the different options, color settings, order, and content. The preview is a “schematic.” It does not load the front-end CSS (it is not a good idea to load in the WordPress admin), so the actual language switcher will be styled differently. Settings for footer language switcher Live Preview Showing Language Switcher OptionsĪs you change the settings of the language switcher, the preview updates.
#Wpml custom language switcher shortcode full
This allows you full and independent control over what it includes and how it looks.įor example, the following image displays a dialog box with settings for the footer language switcher. Full Control Over Each Language SwitcherĮach language switcher type has its own settings. Separate sections for each type of a language switcherĮach section has its own button to Add a new language switcher, a Pencil icon to edit the existing switcher, and a Trash icon to delete a language switcher. When you configure a language switcher, you can see a working preview of it, as displayed in the following image. For example, you can display only flags in the menu, but flags and the language name in the footer. The options you apply to language switchers in each location only apply to that language switcher. You can add language switchers to 3 different places on your site: in the menu, in a widget, or in the footer.


If the language switcher is not displaying right with your theme, there could be a CSS conflict. Language switchers added using WPML look good on most themes. You can also use it to show links above or below your posts, offering them in other languages.

WPML lets you add a language switcher in different ways: in a menu, as a widget, or in the site’s footer. A language switcher allows visitors to select the language in which they want to read your content.
