Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display language switcher as dropdown in Polylang?

I don't have display as dropdown in Appereance -> Menu -> Language switcher. How can i solve it?

Here is an image

Here is an image

Any help will be appreciated...

like image 600
Steve Avatar asked Jun 30 '17 08:06

Steve


People also ask

How to add the Polylang language switcher to your website?

With Polylang you have the possibility to add our widget Language switcher, in the Appearance tab > Widgets sub-tab, by first adding a block “Legacy Widget” in which you then select the Polylang Language Switcher. This option works with Polylang Pro for existing widgets only, it is no longer possible to add it.

How do I add a language switcher to the menu?

In appearance->menus, go in screen options on top right of you screen and check the “Language switcher” checkbox. You then should have a new metabox which allows to add a language switcher just as you add another menu item. Thanks for contributing an answer to Stack Overflow!

How to change the language of a block in the editor?

To do so simply search for “Language Switcher” in the search form of the block editor in your Appearance tab > Widgets sub-tab. Click on the icon of the block, it will add it to the main blocks list (central scroll zone) and open the block editor embedded view in witch you’ll find all the “Language Switcher” options.

What is the language switcher and how does it work?

The purpose of the language switcher is to create links to the translations of your current page. By default, if the current page is untranslated, the language switcher links to the front page in the corresponding language.


2 Answers

You should alternatively use the PHP function to display it, try this

<?php pll_the_languages( array( 'dropdown' => 1 ) ); ?>

The documentation is here - https://polylang.pro/doc/function-reference/#pll_the_languages

like image 74
NJENGAH Avatar answered Nov 15 '22 08:11

NJENGAH


In appearance->menus, go in screen options on top right of you screen and check the “Language switcher” checkbox. You then should have a new metabox which allows to add a language switcher just as you add another menu item.

like image 45
Tasneem Kh.Nsour Avatar answered Nov 15 '22 07:11

Tasneem Kh.Nsour