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 thread is resolved. Here is a description of the problem and solution.

Problem: when I use the language switcher I get error 404

Solution: this specific language switcher is created by the theme, not by WPML. The WPML one works, so you can either use this one or contact your theme support about this.

This topic contains 11 replies, has 2 voices.

Last updated by stuartM-7 3 months, 1 week ago.

Assigned support staff: Laura.

Author Posts
July 3, 2019 at 1:07 pm #4136641

stuartM-7

I am trying to: Get the language switching flags to navigate the user from a foreign language page to the default language page (UK).

Link to a page where the issue can be seen:
hidden link then click the UK flag

hidden link this page seems to work ok, but not for sub pages
hidden link

I expected to see:
When using the language switcher form any foreign language home page to the UK, I expect to see the UK homepage.

Also, the sub pages are causing the same issue.

Instead, I got:
404 error

July 5, 2019 at 12:33 pm #4151339

stuartM-7

How do I remove the flag icons and re-add them?

July 5, 2019 at 12:52 pm #4151393

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

you can change flags in WPML > Languages > Edit languages.

July 5, 2019 at 1:05 pm #4151473

stuartM-7

Am i able to get back on to the online chat with you about this issue as I still have a problem.

July 5, 2019 at 1:47 pm #4151723

stuartM-7

Would giving you access to my staging environment help?

July 5, 2019 at 2:38 pm #4152191

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

it's not possible to reopen a chat once it has been moved over the forum.

Access to the staging environment could help, but I still don't understand if the language switcher you have issues with is the WPML or if it's created by the theme. If it's the latter, you should ask your theme's support first, as we can't offer support for someone else's code.

I'll enable a private reply for the credentials.

July 9, 2019 at 10:12 am #4169605

stuartM-7

Just checking if you need anything further from me to continue investigating my issue?

July 10, 2019 at 8:32 am #4177327

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

it seems your language switcher is created by the theme - if I enable the Twenty Nineteen theme, for example, is not visible anymore but I couldn't find where you can activate it.

I tried to add the standard WPML language switcher to the menu and it's working, as you can see here: hidden link
There are no strange redirects.

So I'd suggest contacting your theme's support to see if how do you remove the language switcher, and to replace it with a WPML one. You can ask us again if you have issue positioning the switcher following the documentation here: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#custom-locations

July 10, 2019 at 9:12 am #4177595

stuartM-7

Thanks for getting to the bottom of this issue. I have removed the code from my theme and would like to implement the example you have already shown me. I am happy for the flag to appear at the end of the menu, but how do I get it so it appears as a dropdown in the screen shot example.

hidden link

Alternatively, what shortcode can I use to output the flag icons. I can then use this shortcode where the old flag icons were.

Hope this makes sense?

Thanks again.

Stuart

July 10, 2019 at 12:02 pm #4179937

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi Stuart,

yes, it makes sense 🙂

You can customize the menu language switcher in WPML > Languages > Menu language switcher. When you add a new one you can choose it as a dropdown.

If instead, you want to place the language switcher where the previous one was, you can use the WPML shortcodes as described here: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#using-wpml-shortcodes
You have to customize your language switcher first and then the shortcode will return it.

July 11, 2019 at 10:26 am #4188657

stuartM-7

Thanks for your help, I believe that's fixed the issue now.

July 11, 2019 at 10:27 am #4188663

stuartM-7

My issue is resolved now. Thank you!