Skip Navigation

[Resolved] Query post with primary language if no post found from other language

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 5 months ago.

Author
Posts
#1102616

Dear Sir/Madam,

I install both WPML and Toolset plugins. My site has two languages, the primary is English, and the secondary is Traditional Chinese. Basically, most of the posts have both languages but there is one custom post has only the primary language. When I call the View, by default it will automatically query the post according to the current language of a page I view, how can I query the primary language post if no post found from the second language?

Best regards,

Kelvin.

#1103242

This is a question that should be asked in WPML forum because the Supporters there are much more familiar with WPML and languages handling.

In Views, this is not possible (there is no setting for this)

If I recall right, WPML has a setting in WPML > Languages > what to show if there is no translation (or similar)

I think that should do exactly what you need (load x if y is not there).

That should then be adapted by Views automatically as Views itself doesn't handle translations, it just "gets and displays" what it is told to. I hence think adjusting WPML will be enough.
If you need assistance with WPML settings, I suggest to reach out here:
https://wpml.org/forums/forum/english-support/