The code turns out to be (.php): which indicates that you should enter it in (functions.php) from your theme editor.
– Appearance / Theme Editor / Functions.php –
Sometimes, however, entering any code from there could cause serious problems for the website. To prevent this from happening, I recommend using the plugin (PHP code snippet).
Back up your site before doing any of these maneuvers.
Hi, thank you for taking the time to help. OK, I understand, I am familiar with the plugin PHP code Snippet, thanks.
But as far as I know for this piece of code:
<?php pll_the_languages();?>
I should find the exact place where to paste into. So that it it shows up in the front end where I would like it to appear. Am I wrong? Otherwise how do I make it appear in the header next to the hamburger icon?
Thanks!
Hi, khrisme, I would tell you … I had to do something I had never done before: I downloaded and installed Polylang to understand how to insert the selector in the menu.
And here’s what came out … First you should create a different menu for each language. Example: For pages in Italian, you will create a menu for Italian only. For German pages, you will create a menu for German only and so on …
From the wordpress control panel, move your mouse to Appearance / Menu / Create a new menu.
From (Screen settings), which you see at the top, select the item (Language selector): select Languages and then click Add to Menu. “save the changes by clicking on Save Menu.
Let them know …
Really nice of you, many thanks, indeed 🙂
But sorry, this is not what i need. I have already created my site, I understand and I have already added my menus of different languages.
What I would need right now is to add the language selector to a custom place.
This place is next to the hamburger menu in the header using theme OceanWP.
This a custom place where I would like the language selector to appear.
Thank you, indeed 🙂
Excuse me … But the translation is bad. I am Italian and I use a translator! In short, has the problem you hoped to solve has been solved?
No, sorry, it has not been solved…
I just wanted to thank you for the efforts you make.
Hi,
Try to edit the partial/mobile/mobile-icon.php file using the child theme or use the hook ocean_before_mobile_icon to hook content that you want before the menu icon and check.
Hey @khrisme got any solution on this? I wish to do the same thing.
Hi @jonnyboy1,
no, sorry, I haven’t dived into it deeper… I might have a look in a few days, but if you take a look and make it happen, just be so kind and let me know, please 🙂