get_posts not working if CPT lang support is not activated
-
Hello!
I have a bit of a specific problem, but I’m sure I’m not the only one with this.
We installed Polylang on our website, but there is one custom post type we DON’T want to translate. These CPTs should always be queried in English. That’s why we didn’t activate the language support for this CPT in the settings.
We query this CPT with get_posts(). In the English version of the website it works perfectly fine, but the other languages return zero. Do you know why and what the solution is?
I think, one solution would be activating the language support for the CPT and the resaving and using ‘lang’ => ” in get_posts(). But this probably will pollute the database unnecessarily, so it should be the last option.
Thanks!
- The topic ‘get_posts not working if CPT lang support is not activated’ is closed to new replies.