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

Last updated by mariaP-27 1 month ago.

Assigned support staff: Noman.

Author Posts
September 11, 2019 at 1:12 pm #4553583

mariaP-27

I am trying to:I have coded a custom language switcher in php (you can find it in header.php). The languages are shown when clicking on the globe icon.

Link to a page where the issue can be seen:hidden link

I expected to see:In my code I use $l['url'] to link to each language.

Instead, I got:The link for English (EN) is always wrong. English is the default language. The link always is to active language.

Have I done something wrong in my php code?

September 11, 2019 at 4:21 pm #4555265

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. Please make sure you have followed this doc for custom language language:
https://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/

If still issue persists, please provide temporary access (WP-Admin and FTP Login info) to your site, so that I can look into your setup and debug the issue.

Your next answer will be private which means only you and I have access to it.

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank you

September 12, 2019 at 7:38 am #4558933

Noman
Supporter

Languages: English (English )

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

Hi,

I have logged in to your site and added z-index:999 property to language switcher div tag and issue is gone. Could you please check and confirm?

Thank you

September 12, 2019 at 8:18 am #4559233

mariaP-27

Yes, it works fine now!
Thank you!

I just noticed one more thing. I have a language (Serbian) marked as hidden, but it is displayed in my custom language switcher (for example here: hidden link). How can I hide it (but display it when I mark the language as "not hidden")?

September 12, 2019 at 4:06 pm #4562943

Noman
Supporter

Languages: English (English )

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

Glad to hear it’s working fine now. I just visited your site and Serbian language seems hidden as it should, have you been able to correct your problem?

Thank you

September 16, 2019 at 7:13 am #4576793

mariaP-27

Yes it was something that slipped my attention. Thank you!