Home›Support›English Support›[Resolved] Translated taxonomy terms no longer pull in untranslated post items
[Resolved] Translated taxonomy terms no longer pull in untranslated post items
This thread is resolved. Here is a description of the problem and solution.
Problem: If you have set your site to display untranslated items in alternate languages and have done the same for taxonomy terms, you might encounter an issue where, after translating a taxonomy term, it fails to pull in associated post items that are not translated into the alternate language and are assigned to the translated taxonomy term.
Solution: We recommend checking the following documentation on how to display untranslated taxonomy values as a fallback:
It is important to note that if you have the 'Translatable - use translation if available or fallback to default language' setting enabled for any post type, all posts belonging to those post types will be associated with the default language taxonomies. This means that if you translate the taxonomies, there will be no posts associated with them in the secondary language unless you change the settings for your items to 'Duplicate'.
If this solution does not seem relevant to your situation, please do not hesitate to open a new support ticket with us here.
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.
If you configure your site to show untranslated items in alternate languages and do the same for taxonomy terms, once you translate a taxonomy term it no longer pulls in associated post items that are not translated into the alternate language and assigned your translated taxonomy term. Example below:
- Configure your site with English as the primary language and Spanish as an alternate language
- Go to WPML settings and set category and posts to "Translatable - use translation if available or fallback to default language"
- Create a post category named 'Test Category' in English
- Create a new post named 'Test Post' and assign the 'Test Category' in English
- Run a query in your theme to pull in posts based on the category of 'test-category' such as below:
- View the frontend in the Spanish language. Observe that the query above pulls in the untranslated 'Test Post' blog post.
- Translate the 'Test Category' taxonomy term into Spanish 'Test Category - ES'
- View the frontend in the Spanish Language. Observe that the query brings in no results. I'd expect to still see the 'Test Post' blog post.
Translated taxonomy terms should bring in any translated post items and also it should look at the associated term it was translated from, and find any untranslated items that were assigned to the term it's been associated with.
*****
If you have the Translatable – use translation if available or fallback to default language setting enabled for any post type, all posts belonging to those post types will be associated with the default language taxonomies. This is because this translation option doesn’t create any posts in the second language, so if you translate the taxonomies there will be no posts associated with them.
For example, in WooCommerce, if you have the Translatable – use translation if available or fallback to default language setting enabled, you won’t see any items on the archive page for your taxonomies in the secondary language. You must change settings for your products to Duplicate. After this, you can use translated taxonomies on your product pages.
*****
Does it help explain how this should work or is your case a bit different than above?
Ah okay yes this article helps clarify things. Specifically "if you translate the taxonomies there will be no posts associated with them" - I consider this an unfortunate bug. If I translate a taxonomy, it's still 'connected' to the original taxonomy it was translated from. In my opinion posts that have not been translated yet and are assigned a taxonomy should show up even if I translated the taxonomy.