Hi,
Polylang gives the dropdown feature only in Appareance > Widget > Language switcher:Displays as dropdown. Not in menu.
Thread Starter
Advex
(@totalfly)
Hi..
the idea is how can put the languages in a dropdown menu in the main nav bar..
Thread Starter
Advex
(@totalfly)
unfortunately i’m not a developer.. anyway is write to attach the following code:
<?php // outputs a list of languages names ?>
<ul><?php pll_the_languages(); ?></ul>
<?php // outputs a flags list (without languages names) ?>
<ul><?php pll_the_languages(array('show_flags'=>1,'show_names'=>0)); ?></ul>
<?php // outputs a dropdown list of languages names ?>
<?php pll_the_languages(array('dropdown'=>1)); ?>
but the problem is: where have i to insert these strings? in which file?
Basic solution :
1) Install this plugin
https://wordpress.org/plugins/iconic-navigation/
or
https://wordpress.org/plugins/menu-icons/
2) Go to go to Appearance > Menus and at the top right of the page select “settings screen”
3) Flag “Language selector” into the options
4) Now you can add a free link item ” LANGUAGE ” and change the icon of it with the plugin at 1 point ( add a tranlation icon )
5) At the end you can add the selector button under “LANGUAGE” as submenu.
—-
Advanced solutions :
Advanced user can add this code to the header.php file of your theme
After “has_nav_menu”
<ul class=”lang-switch”>
<?php pll_the_languages(array(‘show_flags’=>1,’show_names’=>0)); ?>
Than add css to your theme
.lang-switch {
float:right;
}
.lang-item {
display:inline;
}
———–
Happy new year,
Emanuel
Thread Starter
Advex
(@totalfly)
Thank you so much.. i used the second solution and is working now. 😉
Best regards and happy new year! 🙂
How to align switcher to right in menu ? Standard is to left.