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 3 replies, has 2 voices.

Last updated by mateV-2 3 months, 2 weeks ago.

Assigned support staff: Bobby.

Author Posts
July 2, 2019 at 11:28 pm

mateV-2

I am trying to: Switch from Croatian language to English language

Link to a page where the issue can be seen: hidden link or hidden link (addon domains)

I expected to see: Working language switch.

Instead, I got:A wordpress login page.
Issue does not happen when Im logged in as an administrator.

July 3, 2019 at 2:09 am #4130805

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

there seems to be a 302 redirection on the URL .

This seems to be caused by your current theme , are you using any custom code within the theme? I test the site on our cloudways staging servers and can verify that the issue is resolved when switching to a default WP theme. ex. Twenty16

hidden link

HTTP/1.1 302 Found
Date: Wed, 03 Jul 2019 00:49:42 GMT
Server: Apache
X-Powered-By: PHP/7.2.19
X-Redirect-By: WordPress
Location: hidden link
Vary: User-Agent
Content-Length: 0
Content-Type: text/html; charset=UTF-8

hidden link

July 3, 2019 at 8:42 am #4133399

mateV-2

Hola Bobby,

Yes, we are using the theme AIRI by LA themes. Beyond using simple CSS customisation, there are no custom codes within the theme except for a PHP snippet to hide other shipping methods when free shipping is available.

Why in the world would a theme redirect WPML language switcher? Any idea on what to check for? We pushed the site live on monday because of the increased interest in the webshop.

EDIT:
Thanks for all your help - I quickly scanned through the possible PHP files within the theme and found a snippet that is used in theme-enabled maintenance:

                if(empty($page_id)){
                    wp_redirect(wp_login_url());
                    exit;
                }

I have commented out the entire function and now it works.

July 3, 2019 at 8:59 am #4133629

mateV-2

My issue is resolved now. Thank you!