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.

This topic contains 1 reply, has 2 voices.

Last updated by Izzi Hassan 3 years, 11 months ago.

Assisted by: Izzi Hassan.

Author Posts
January 22, 2021 at 6:07 pm #7908719

ianH-10

Tell us what you are trying to do?

What’s happening is when you are logged into the website, the language code comes back with the correct language. When logged out of the website, it seems to only come back with the default language (en) when making an AJAX call through WordPress.

AJAX should be detecting the current language even if logged out.

The language parameters are not getting passed to the AJAX request when logged out.

Is there any documentation that you are following?

Documentation for this issue is unclear.

Is there a similar example that we can see?

Visit the link below and click on "Graine" and you will see English results populate. But when logged into the site, French results appear.

What is the link to your site?

hidden link

January 25, 2021 at 8:33 am #7918657

Izzi Hassan

Hi,

Thank you for reaching out to WPML Support.

I think your issue can be resolved by enabling the setting mentioned in this article:
https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/

We are moving towards enabling this setting by default in future versions of WPML. It was disabled by default due to issues with some caching plugins a while back.

Please do let us know if you have any further issues!

Best,
Izzi