This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing an issue where a custom post type 'projekt' displays duplicate entries in a secondary language (Swedish) despite setting the language parameter in WP_Query. The query fetches posts from both the default (Polish) and secondary language, leading to content duplication on the Swedish page.
Solution:
We recommended removing the 'lang' => $current_lang from the WP_Query and testing without it. If the issue persists, it might be related to other parts of the custom code. We advised testing the issue in a minimal environment using a default WordPress theme and only essential plugins to confirm if the problem is related to WPML or the custom code. Additionally, we provided a working code example for querying WooCommerce products to demonstrate a similar setup that functions correctly. If the problem continues, further debugging of the custom code or consultation with a developer might be necessary.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.
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 15 replies, has 0 voices.
Last updated by 2 months, 1 week ago.
Assisted by: Dražen.