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: I want to be able to only see the available translations languages in the language switcher.

Solution: go to WPML > Settings > Post Type Translation > Set your posts as "translatable - Only show translated items" > press Apply button

Relevant Documentation: https://wpml.org/documentation/getting-started-guide/translating-custom-posts/

This topic contains 2 replies, has 2 voices.

Last updated by matthiasR-5 3 months, 2 weeks ago.

Assigned support staff: Alejandro.

Author Posts
June 28, 2019 at 12:38 pm #4107425

matthiasR-5

I am trying to: We integrated a language menu in our header, some of our pages only have an English translation and no German translation. German is the base language of the site though. WPML still shows the German as a language in the language switcher, which it shouldn't since the language doesn't exist, and if you click on German it just displays the English site.

We integrated the language switcher as following:

$languages = apply_filters('wpml_active_languages', null, 'orderby=id&order=desc');

And then we loop over the languages.

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

I expected to see: "DE" to be hidden in the language menu.

Instead, I got: you can see "DE" in the language menu.

June 28, 2019 at 2:55 pm #4108817

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

Hello!
Welcome to WPML Support.
I'll do my best to help you solve this issue.

To better understand how to move forward with a solution, could you please provide me with information about your environment by following these steps: http://wpml.org/faq/provide-debug-information-faster-support/

It looks like you set the pages to be translatable but show the fallback option if the page doesn't exist.

You can check this in WPML> settings > Post type translation > Pages > Set it to "translatable - Only show translated items"

Let me know how it goes.

July 1, 2019 at 4:21 pm #4121143

matthiasR-5

Thanks Alejandro, that solved my issues! Appreciate the quick help! 🙂