This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was experiencing an issue where posts were not displaying unless one post was translated, even though the WPML settings were set to 'Translatable - use translation if available or fallback to default language'. The posts were sorted by a custom taxonomy and needed to be visible in the Spanish translation without being translated, as they linked to primarily English content.
Solution:
We resolved the issue by adding the parameter
'hide_empty' => false
to the
get_terms()
function in the custom WP_Query. This allowed terms with no posts translated into the secondary language to be displayed.
$terms = get_terms(array( 'taxonomy' => $taxonomy_slug, 'child_of' => $parent_term_id, // Specify the parent term ID 'hide_empty' => false ));
If you're experiencing a similar issue, we recommend trying this solution. However, please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us.
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 16 replies, has 2 voices.
Last updated by 8 months, 3 weeks ago.
Assisted by: Long Nguyen.