Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1261593

    begeistert
    Participant

    Hello X-Theme-Support,

    I have this chanllenge.

    My site has to be multilingual – so I ordered WPML. Works fine.
    Than I realized I need at least 2 menues for Hone site is onepage navigation via anchors and second level pages have to link to dofferent pages within the menue. So I set um Menue Swapper. Works fine.

    Now the challenge: WPML supports the Language switcher only for one menue. There it displayes a Dropdown for supportet language behind the last link.

    But I need to have the switcher behind every menu.

    So they say “just add this code in your template for geting the switcher”: <?php do_action(‘wpml_add_language_selector’); ?>

    But where is the location for it in X-theme-child-theme?

    Can you help me please?

    thank you very much.

    #1262057

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! In the given instruction here: https://wpml.org/wpml-hook/wpml_add_language_selector/, you need to add the code in the location you want the language switcher to display. You can provide us screenshot as to where you want it on the page so we can help you.

    Moreover, you might be interested in checking out this pages:
    https://wpml.org/forums/topic/how-to-add-the-language-selector-to-my-menu/
    https://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/

    Hope this helps.

    #1283763

    begeistert
    Participant

    Hi Rue Nel,

    here ist the screen of the Home site (1). There the WPML makes the insert correct (as configured).

    the second screenshot (1) is site a level under home with another menue assigned. Here I want to place the Language switcher as in Home site.

    #1284943

    Jack
    Keymaster

    Hi there,

    Thanks for writing back. As it’s in the header. You’ll want to copy the header file for the global header you’re using to the child theme and then add the modified code.

    For example, copy the file from x/views/global/_header.php and copy that to the same destination to your child theme and then add the code for the language switcher within that file. Save and then refresh your site. The language switcher should then display correctly.

    You can do it after either action, either:

      <?php do_action( 'x_before_site_begin' ); ?>
    

    Or

    <?php do_action( 'x_after_site_begin' ); ?>

    Thanks!

    #1317948

    begeistert
    Participant

    We can close this – not because it is solved, but because X Theme supports WPML but WPML not the menue swapper. So I will open an other Thread called: X-Theme with WPML Laguage Switcher in all Menus displayed in one Menu-Location

    Thank you.

    #1318061

    Nico
    Moderator

    Okay no problem. Feel free to open a new thread.

    Thanks.