Skip Navigation

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.

Our next available supporter will start replying to tickets in about 1.35 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by robertoB-80 12 hours, 41 minutes ago.

Assisted by: Andreas W..

Author Posts
September 27, 2024 at 12:05 am #16227744

robertoB-80

<b>Background of the issue: </b>
In my site, I have 3 languages: Croatian (default) at hidden link, English at hidden link, and German at hidden link. The front page structure includes a photo album and a static page set in WP settings. I am using WPML for language switching.

<b>Symptoms: </b>
When I click the dropdown flag to change the language on the front page, the URL is incorrect. For example, for English, the URL is hidden link instead of hidden link. The same issue occurs for the default language.

<b>Questions: </b>
How can I fix the URL issue when switching languages using the dropdown flag on the front page?

September 27, 2024 at 6:42 am #16228241

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I can see even the same issue when switching to German or Croatian.

hidden link
hidden link

Revising the source code it looks as if the site is using hardcoded links, that are placed directly inside the theme instead of using the WPML Language Switcher.

Usually, this might be a topic for the theme developer. WPML's Custom Language Switcher needs to be included in the Header template of the theme by calling:

 do_action('wpml_add_language_selector');

Example::
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

To confirm that WPML handles the redirections correctly, you can go to WPML > Languages and enable WPML's Footer Language Switcher.

Let me know if this switcher works as expected.

Best regards
Andreas

September 27, 2024 at 11:26 am #16229616

robertoB-80

I enable Footer language switcher, but cannot see switcher in footer.
Also try add menu in Main menu and problem is still here.
Try Add widget in footer and url is still wrong

September 27, 2024 at 5:37 pm #16230991

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you for your message!

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may have to install a plugin called "All In One WP Migration" to make a copy of the website where I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or copy of the website from your server yourself for this purpose. This step would only be required if the issue is replicable on such a staging site.

If you have any questions about creating such a staging site, you can consult your hosting provider. Just take note that WPML should be registered on this site again.

If you are unable to provide such a copy of the site for testing, please let me know on this ticket.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.