Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client has a custom post type

nb_poems

set to untranslatable, with a translatable custom taxonomy

poem-tags

The terms are translated and linked correctly in the default language, but when switching to a different language, each term shows 0 posts linked in both backend and frontend.
Solution:
We recommend the following steps:
1) Back up your site.
2) Navigate to WPML >> Settings >> Post Types Translation.
3) Set the

nb_poems

post type to Translatable – use translation if available or fallback to default language.
4) Save the changes.
5) Clear all types of caches.

This should resolve the issue in the frontend, allowing posts to fall back to the default language if they are not translated. However, in the backend, the taxonomy terms will still show a post count of zero in secondary languages because the posts themselves are not translated.
For more details, please refer to the following articles:

If this solution doesn't look relevant, please open a new support ticket.

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.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Bigul 1 year, 5 months ago.

Assisted by: Bigul.

Author Posts
January 17, 2024 at 1:19 pm #15195072

laurenzN

Hi,

i've created a custom post type "nb_poems" whose posts are set to untranslatable. The custom taxonomy "poem-tags" contains associated tags, and this taxonomy is translatable. These terms have been translated, the translated terms are linked correctly to the terms in the default language.

In the backend, i see a correct number of associated posts when i'm in the default language. But when i switch to a different language, every term has 0 posts linked. In the frontend, i have the same result.

Is WPML expected to handle this case transparently or do i have to translate IDs back and forth using e. g. wpml_object_id?

Thanks in advance for any advice.

January 17, 2024 at 5:19 pm #15196351

Bigul
WPML Supporter since 01/2013

Languages: English (English )

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

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

This is an expected result because the Post Type is selected as *Not translate*. Please try the following steps after a site backup & make sure you are getting the expected results or not.

1) Visit WPML>>Settings>>Post Types Translation
2) Choose *Translatable – use translation if available or fallback to default language* option for *nb_poems*
3) Save the changes
4) Clear all types of caches

It will help you to get the expected results in the frontend. In the backend, the taxonomy terms will show the post count as zero in a secondary language. Because the posts are not translated.

Please refer to the following articles for more details.

https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#using-the-default-language-as-a-fallback-for-untranslated-content

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

--
Thanks!

Bigul