• Hi there,

    first of all thank you for the great theme!

    I would like to add Polylang flags in fornt of the hamuger menu or after it in the mobile header. Polylang works really great with OceanWP, I am amazed by your theme.

    There is an instruction but could you let me know where to apply this code, please?
    I am using demo Simple.

    Thank you much for taking the time.

    Polylang says:
    It is possible to get a language switcher where you want in your theme without using the widget. For this, you can simply add in your theme the following instruction:

    <?php pll_the_languages();?>

    Ref.:
    https://polylang.pro/doc/the-language-switcher/#add-language-switcher
    1.3 Add a language switcher anywhere
    You can include a language switcher anywhere in your site by using the PHP template tag pll_the_languages().

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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.

    Thread Starter khrisme

    (@khrisme)

    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 …

    Thread Starter khrisme

    (@khrisme)

    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?

    Thread Starter khrisme

    (@khrisme)

    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.

    Thread Starter khrisme

    (@khrisme)

    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 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Adding content before hamburger icon in mobile header’ is closed to new replies.