![]() Polylang works fine with browser language recognition, but navigationwise Polylang has not been working for one single day out 100 days+ being installed. Polylang provides a widget to display the language switcher. If you don’t see the language switcher metabox, check that it is not disabled in the screen options. You can include the Polylang language switcher in your menu. Add a language switcher 1.1 Add a language switcher in the menus. If there is no content in any language, then the language switcher does not appear at all. You have the possibility to add a language switcher anywhere in a menu. Under ‘Menu Settings’ assign your menus to the relevant theme location, for example ‘My English Menu’ to ‘Primary menu English’ and ‘My French Menu’ to ‘Primary menu Français’. You have to create one menu per language and save them. Due to WordPress limitations, it is currently not possible to add the language switcher from the Customizer Menus. You then should have a new metabox which allows you to add a language switcher the same way you add other menu items. In Appearance >Menus, go to screen options on top right of your screen and check the “Language switcher” checkbox. When selecting the dropdown, the list will display only the language names and no flags. This option allows you to choose whether to display the languages as a list (default) or as a select dropdown. Whatever the chosen options, the widget will display a language only if at least one post or one page has been published in this language. Polylang adds a new widget to display a language switcher. You can use as many languages as you want. The translation, whether it is in the default language or not, is optional. You write your posts, pages and create categories and post tags as usual, and assign a language to each of them. With over 500,000 installs, Polylang is the most popular multilingual plugin available on the WordPress directory. Moreover it offers the possibility to use, at your option, one directory, one subdomain or one domain per language. Polylang is compatible with major SEO plugins and automatically takes care of multilingual SEO such as html hreflang tags and opengraph tags. The default language will be assigned to all the existing content by default. It is important that each content has a language otherwise your content is not displayed on the front end. If you are installing and activating Polylang on an existing website, then all the existing contents have no language assigned yet. Polylang was first designed to avoid modifying URL as much as possible and so, by default, adds the language information to the URL only when there is no other way to do (mainly the archives) and does not add it when it is not necessary (posts, pages, categories, post tags). ![]() The default language is indicated by the star icon in the languages list table. Set the default language to the existing content. If there is no content in any language, then the language switcher does not appear at all.Īssign a language thanks to the Bulk Action Note: If you change the language of some content already translated in other languages, you will loose the link with the translations in other languages. Note: To avoid 404 errors, Polylang does not display a language on frontend if there is no published content (post or page) in that language. See also accompanying css.By default, if the current page is untranslated, the language switcher links to the front page in the corresponding language. To define a new widget area, add the following code to the functions.php file in your child theme: // Adds a widget area to house a Polylang dropdown. This time we’ll add a widget area after the navbar, where you can place the Language Switcher dropdown. ![]() I showed you how to add one after the header here. ![]() Well, it turns out that defining your own widget area is actually quite easy. If you need the Language Switcher to be at the top so that users can see it easily and switch immediately to their language, what can you do? And in any case, with Customizr’s front page, sidebars are not even shown at the top of the page. Customizr’s widgets (like in many other themes) are in the footer and in the sidebars. This snippet shows you how to do this, using a navbar widgetīy default, the Polylang Language Switcher-which gives you a “dropdown” option-is set up to be dragged inside a widget area. However, it doesn’t give you an option to put a dropdown in the menu/header area. It even has an option for you to include flags or language names (or both), directly to the menu, with no coding. A couple of months ago, I showed how to use the Polylang language plugin with Customizr.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |