Just add the following code (for a dropdown language switcher)
<?php pll_the_languages(array('dropdown'=>1)); ?>
for example in the header.php of your theme to put it at the very TOP of your site.
And have a look at the documentation:
http://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/
There you can find other parameters to change the switcher.
I get like fatal error:
Fatal error: Call to undefined function pll_the_languages()
That looks like the Plugin “polylang” is de-activated.
Maybe you can test, whether the plugin is activated.
<?php
if( class_exists('Polylang') && function_exists('pll_the_languages') ) {
return 'Yeah, the plugin is activated and should be displayed!';
} else {
return 'FAIL!';
}
?>
If you get the second return, please have a look at your pluginlist and activate polylang if it is not. Otherwise there is maybe another error.
Where have you put in the pll_the_languages();
function?
Yes! you are right, it was deactivated. sorry 🙂
So now its on top, but left side, how to change to right side?
And if I change to flags, then other flags goes under each other and language name shows, how to leave only flags and no names? and change to horizontal position, I have tried code:
.lang-item {
display: inline;
}
but it don’t work for flags, for names it works.
Do you have a solution for that or do need any help?
If so, thats seems to be a kind of CSS changes. Can you post the URL of your site, so I can have a look at myself?