This thread is resolved. Here is a description of the problem and solution.
Problem:
The client uses the legacy Views editor to create a View to display taxonomy terms.
The texts from the View are translated via String Translation, but on the translated page the View query returns no results, unlike in the default language where all of the taxonomy terms are shown.
Solution:
The problem was that the output of the View is ordered by a taxonomy custom field, and in WPML settings that term field is set as Do not translate. That means that in the secondary language the terms have no values for that custom term field.
It is a quirk of WordPress that when ordering by some thing, and potential results that have no value for that thing will be excluded from the results.
The solution is to copy or translate the custom term fields.
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.
As you may be aware, the Toolset View block is integrated with WPML so that when translating a page containing such a View all of it's texts are offered for translation.
When switching to the Spanish page, the View doesn't find any results. That means that the content being queried (maybe you have a "flag" custom post type) has not been translated, and so there are no results to show on the Spanish page.
So you will first need to translate the "flag" content, and then worry about translating any strings output by the View, by using the wpml-string shortcode.
On the page where you have inserted the shortcode for the Toolset View (including on the translated page), add the cached="off" attribute to the wpv-view shortcode.
If your categories are translated double-check that the translated categories are assigned to some posts so that the term count is not zero.
I'll want to temporarily add one or two plugins to aid with debugging, if that's okay.
Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.
OK, I spotted a couple of things, the first is simply that you missed a quote when adding the cached="off" attribute, which I fixed on this site copy.
That didn't resolve the problem, but I see the cause of it is that you are ordering your View by a term meta field (clean country name), and that that field is set to not translate.
That means that the translated categories have no value in the database for that field, and it is a quirk of WordPress that if you order a query (in this case a taxonomy query) by something, potential results that have no value for that thing are omitted.
ah of course I totally forgot I changed that! thank you! I have moved this to be translated now but I can't for the life of me figure out how to translate it?
The page does not flag it still as needing translation, can't find it in translation management or in strings. (made this change on the live site to try and do it).
If you have marked the taxonomy custom term meta for translation then when you edit term translations via WPML > Taxonomy translation you will see the term meta offered for translation (screenshot is from my own test site).
Yes but only recently is there a way to trigger the system knowing about this change?
I changed resaving the page but that made no difference.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.