Skip Navigation

[Resolved] View returns no item found

This thread is resolved. Here is a description of the problem and solution.

Problem:
My View has no Query Filter but it should return a list of all posts.
I see only "No results found".
I order the View Results by a Custom Field.
What could be wrong?

Solution:
YOur Custom Field does either not exist or does not have meta data saved for all the posts.

Please make sure, all the posts have that field saved with some values, and if not all do, make a secondaray order by choice in the View.

This support ticket is created 6 years, 9 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Jonathon Hanten 6 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#548916
CapturFiles-201707195_1607_8.png
CapturFiles-201707195_1607.png
CapturFiles-201707195_1607_1.png
CapturFiles-201707195_1607_2.png
CapturFiles-201707195_1607_3.png
CapturFiles-201707195_1607_4.png
CapturFiles-201707195_1607_5.png
CapturFiles-201707195_1607_6.png
CapturFiles-201707195_1607_7.png

I am trying to: To use or view or an archive of a custom post type (Policy Manual) to show results filtered by a taxonomy.

I visited this URL: hidden link (This is a private site)

I expected to see: A list of the 15 entries for the one taxonomy.

Instead, I got: No items found.

I have other post types that I created with Toolset and views that are all working properly. The built in posts and pages are also working properly.

#549023

Please remove the Query (Custom Search) from that View.
Do the Posts Show?

If yes, re-introduce the search.
Does it fail again?

If yes, then there is an issue with the values and what Views expectes.
As example it could be that you used a Single Line Field in the posts but told Views to filter explecitly as a numeric value.
Since you got a string in there, it would fail.

If that is not the case, please provide me access to the Site.
I will set up an example View where this will work and you can then copy the View or even use it.

#549830

I assume it is this view:
wp-admin/admin.php?page=views-editor&view_id=1513
on this page:
hidden link

So, this View queries Policy Manuals and orders them by the Taxonomy "Section Number" in a string/descending way.
There is also a secondary ordering by Post Title in case that fails.

If you remove that orderby parameter the View 15 Items exactly as expected.

As I elaborated previously, if the View has to query or order by things that do not exist, it will not return a result.

The issue here is that you ordered value that is actually not a FIELD but a Taxonomy.
That should not even appear in the order options.
There can be only Post native and Custom Fields, but not taxonomies.

How have you made the Taxonomy "Section Number" appear in that dropdown?

Also as far I see, it would make poor sense to order by that (even if it would be a field) as you seem to have only "1000s" values?
Even in the case you would add this value to a field it would fail, as that is a mixed value.
You should use either strings or numbers, that would be better.

Maybe you wanted to order by "Policy Number" instead?
Because that works great, since this is a proper Custom Field.

I added that to the View - please let me know if that is what you need.

#550045

Thank you, this proves that I probably shouldn't build custom post types while sleep deprived and then troubleshoot them even more sleep deprived. What you are saying makes good sense. Your example before made me change the query filter, but I didn't realize I was sorting by a taxonomy which I agree doesn't make sense. I don't know how I got that as an option, but it was there.

Thank you again.

Jonathon

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.