This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 30 replies, has 3 voices.

Last updated by melitaR 3 weeks, 5 days ago.

Assigned support staff: Mihai Apetrei.

Author Posts
September 8, 2019 at 1:06 pm #4531579

melitaR

Hello,

I just started using WPML & have troubles already at the beginning...
sorry about that.
I need the language switcher to be in the header just before the hamburger menu icon, instead of the menu as I am using the side menu on my theme (see attached)

Also is it possible to change the default language name, for example, I am using only German & English, so the switcher would be only named DE / EN?
My site is in maintenance mode right now, kindly let me know if any temporary credentials are necessary.

Thank you in advance
kind regards,

September 8, 2019 at 1:29 pm #4531681

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support.

1. The possibility to add your language switcher on that position depends on your theme. Does your theme provides you the option to add a content (for example a widget) or some code exactly on the position that you wish?

You can use below code to show custom language switcher on specific position:

do_action('wpml_add_language_selector');

Here is doc for custom language switcher:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#custom-locations

2. If you want to display language code instead of language name please follow the steps below:
- Go to WPML >> Languages >> Edit Languages.
- Add EN / DE in Translation text boxes as in the attached screenshot.

Please let me know if this resolves your issue or you need further assistance with this issue.

Thank you

September 8, 2019 at 3:48 pm #4532003

melitaR

Hello Noman,

thank you for the quick reply!
I already sent the request to the theme developer and hope, by following your instructions I will be able to achieve the look needed.

have a nice Sunday,
best regards
Melita

September 10, 2019 at 10:41 am #4544295

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi Melita,

Noman is currently on a vacation so I will be handling this ticket. Since he provided all the relevant documentation and information we have at our disposal, let me know if the theme developer requires something else and I will be glad to answer.

Regards,
Bruno Kos

September 13, 2019 at 7:36 am #4566133

melitaR

Hi Bruno,
thank you for taking over.
The theme developer is looking to place the switcher in the theme for me.
I think I'll be fine but would still like to keep the topic open until I know for sure.

kind regards
Melita

September 13, 2019 at 8:47 am #4566661

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi Melita,

The ticket will be automatically closed after about 10 days (if no activity) - however, if your theme developer does not fix the issue by then (or if you will need some further information), you can always create a new ticket (or chat) and chose either me or Noman as your preferred supporters and then link to this thread. By doing that, we will be able to help you quickly.

Regards,
Bruno Kos

September 15, 2019 at 7:25 am #4574067

melitaR

Hi Bruno,
I understand. Thank you.
have a nice Sunday,

best
Melita

September 16, 2019 at 5:43 am #4576385

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Ok, let us know how it goes then!

Regards,
Bruno Kos

September 17, 2019 at 7:37 am #4586095

melitaR

Hi Bruno and Noman,
the theme developer didn't manage to make switcher work. He asked if you could take a look at it: "I've added this code:

<?php do_action('wpml_add_language_selector'); ?>
under architecturer\templates\template-topmenu.php and it is showing in the header now.

But for some reason, it is not working. Currently, the language switcher is not working as expected. And you cannot switch languages from that.

Can you please get in touch with the WPML support regarding the issue to fix that?"

kindly let me know if you need the site credentials (it on maintenance mode) and how can I send those in a private message?
thank you in advance,

best regards
Melita

September 17, 2019 at 8:28 am #4586341

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi Melita,

Can you install this modified theme here, so that we can have a look? This is a clean sandbox installation and it will help us exclude any possible conflict with other plugins being used on your installation, thus confirming that this may be a theme compatibility issue.

hidden link
demo
QwD0C781Qevz

Also find WP Sandbox menu item within the sandbox, you'll find SSH and SFTP credentials in case you'll need these. WPML all the other plugins are already there and configured.

Regards,
Bruno Kos

September 17, 2019 at 9:31 am #4587115

melitaR

Hi Bruno,

thank you!
I have installed and activated the theme in the Sandbox. I also installed theme related plugins I am using (as I am not using all of them).
Kindly let me know about your findings.

thank you!
best regards
Melita

September 17, 2019 at 11:01 am #4587843

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can you set up the menu and relevant options so that it has the layout you would like to see on your site?

Also, can you tell me if this theme has already been modified by your developer? If not, can you get information from them on where do we need to put the code in order to have the language switcher in the location you would like to see on your site?

In short, we are trying to emulate the same behavior and set up the developer already set, so that we can see which part of the language switcher is not working.

You can also provide them with WordPress access in case they want to implement the thing themselves.

Regards,
Bruno Kos

September 17, 2019 at 12:02 pm #4588295

melitaR

Hi Bruno,

- I have set up all the settings concerning header and menu as on my page, but I don't see the hamburger menu which opens the side menu. Nevertheless, the switcher should be in the header (I am attaching the screenshot of how it currently looks like). As you can see - the switcher is there but it shows only German so it cannot switch to anything. I have to add that I haven't started translating but would assume that the English flag should be there as an option (my second language) which is set to in the settings as well. I am attaching what I would like to achieve, JPG called Language_switcher_727. I have to mention that I switched two WPML options from the settings because my page is on maintenance mode, these settings were causing that the maintenance mode page created with Elementor was turned off when those were on! I am attaching also a screenshot for that (name of that JPG: WPML_turned_off_settings_702)

- the theme dev already replied where he placed the code for the switcher according to your instructions. architecturer\templates\template-topmenu.php

- there have been no changes made to the theme core, so the only thing theme-dev helped me with is the switcher in the .php

I am glad to provide the credentials, but how can I send them in a private message not open to the rest of the support forum?

THHNX

Melita

September 17, 2019 at 12:03 pm #4588319

melitaR

sorry, I forgot to attach 2 two of the images I mentioned.
Here they are:

September 17, 2019 at 12:50 pm #4588551

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

It seems be working - hidden link, however, there are some things that you will need to do in order to get the exact same layout you desire:
https://wpml.org/forums/topic/show-language-switcher-de-en/#post-1402167

However, this will also depend on the whole layout and may require additional CSS tweaking on your site.

Also check here on how I set this menu:
hidden link
-- Benutzerdefinierte Sprachumschalter --> Anpassen

I also added some CSS, but this is only rough so that I can place it here - the final CSS will require tweaking, also for mobile devices:

.wpml-ls-legacy-list-horizontal {
    border: 1px solid transparent;
    padding: 0px;
    clear: none;
    float: right;
    right: 106px;
    position: relative;
}

@media only screen and (min-width: 1200px) {

#logo_right_button {
    right: 0;
    float: right;
    position: relative;
}

}

In any case, I marked your next reply as private so that I can check what exactly is not working on your site.

Regards,
Bruno Kos