7

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...

Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118
Steve
  • 93
  • 1
  • 1
  • 6
  • Your question hasn´t become any better since posting on WP:SE: [Language switcher, don't have dispaly as dropdown. Polylang on hold](https://wordpress.stackexchange.com/questions/271784/language-switcher-dont-have-dispaly-as-dropdown-polylang) Please improve your question and take note, that this is no plugin support board. – flomei Jun 30 '17 at 08:42
  • 1
    take a look here https://polylang.pro/doc/widgets/ – Luca Reghellin Jun 30 '17 at 09:07
  • 1
    And here: https://polylang.pro/doc-category/the-language-switcher/ – Luca Reghellin Jun 30 '17 at 09:07
  • 1
    And here, if you can code, take a look to pll_the_languages() function: https://polylang.pro/doc/function-reference/ – Luca Reghellin Jun 30 '17 at 09:09
  • 1
    ...And please, do not mind cops. Yes, sadly enough they are everywhere, but there are also people who want to help when common sense can go behind the Sacred Rules. – Luca Reghellin Jun 30 '17 at 09:14
  • you really want to run this with the following categories - home, about us, product , news, contact - language switcher – zero Feb 27 '21 at 14:01

3 Answers3

8

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

NJENGAH
  • 955
  • 15
  • 12
  • Although this is the right answer, I always prefer to give a string name to the `dropdown` argument (`desktop`, `mobile`). The point is that if you use it twice on your page (e.g. mobile and desktop menu) the generated code won't work with `1` as the value (because of non unique DOM id). – Tim Jul 21 '21 at 09:03
2

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.

0

@NJENGAH's answer is correct.

Additionally, if you would like to have 2 drop-downs on the same page, i.e. header and footer, increment the dropdown array value for the subsequent calls by 1.

<?php pll_the_languages( ['dropdown' => 2 ] ); ?>```

and so on...