Skip Navigation

[Resolved] Posts not found in a View

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

Problem:
I have a view that should show hundreds of posts but it shows just a few. Why could that be?

Solution:
Most likely you have either a Query Filter or a Order By argument by a field or data that does not exist for all the posts.
You can check that quickly by removing any Query Filter and Order By with native Post Date, and if then all posts are shown as expected, re-introduce the filters and orderings, to see which one is the culprit.
That will automatically indicate you the field that does not exist for all posts, and you can either update the posts or the View to resolve the issue

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

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 7 replies, has 2 voices.

Last updated by catrionaD 5 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1364333

Hi, I didn't realise Christian doesn't work Fridays. I need urgent support, can you help please?

https://toolset.com/forums/topic/post-not-found-when-connecting-posts-through-relationships/

#1364559

It seems Christian is familiar with your setup because I see no link whatsoever that I could use to start where to see the issue.
I don't know how your site is built at this moment, or where the issue happens, or what the issue actually is (I see you get no results found, but I do not know where, or what you would expect instead)

Can you elaborate on this so I can help?

Generally, when you get "no results found", it is because the Query filters in the View that displays those results, can't find any post.
So that might be a Query filter that queries posts by a relation, or a field, or anything else, and can't find results.

To solve it, generally, you would duplicate that view, insert it to a test page, and remove ALL query filters.
If then you still see "no results found" it's because there is no post of that type.
Usually you will, at this point, see all posts you query in the View.

Hence you can then start re-adding query filters one by one and test each time you add a filter the results
Once the problem happens again, you located the culprit filter, and can therefore determine the source of the issue (for example, if the filter that causes the issue is a "post relationship filter", it means your posts are not related. Or, if it's a filter for a custom field, it may be that the posts do not have that field added).

Please let me know if with above steps you can already locate the culprit - if not, please outline to me the path I need to take on your site so to:
- see the issue
- see the View where this is built
- see the Relationship involved
- see the Post types involved

It is also always a good idea to check if other software may be interfering, hence disabling all other plugins (and eventually using another theme) can sometimes already show what's happening.
Note, this should be done on staging sites, not on live sites (at least, not without a good backup)

I am here today 6 more hours, Christian is back tomorrow.

#1364597

Thanks Beda.

I duplicated the search view and removed all filers. This only showed a few National-listing posts, not the 300 I was expecting, although there are 300 National-listings there.

So I traced this back to the upload plug-in I'm using Ultimate CSV Importer Pro. There are a couple of issues I'm following up with them:
- National-listing posts are not being recognised as national-listing posts when visitors search the site
- Post relationships are no longer being imported (the whole reason for paying for this plug-in)
- And they changed that the taxonomy seperator chaged from | to a comma so e.g. Monday|Tuesday creates a new taxonomy option called Monday|Tuesday

This has been a nightmare couple of days for me trying to work through this. Do you mind if we keep this query open for now? I'll keep investigating and trying to sort this.

#1364611
#1364619

I don't know at this stage if the problem lies with CSV Importer or Toolset, or a mix of both.

CSV Importer have fixed the relationship upload issue but haven't responded yet on the fact that the national-listings posts aren't being picked up by Toolset search. See example here - hidden link
This is a stripped back search. Hundreds of posts should be showing, but they're not.

Do you have my wp-admin details? If you could check this issue isn't on your side that would be really helpful.

#1364627

I see the View lists National listings - there is a total of 937 National Listings published on your Website: hidden link

So, if there are no further queries or limitations the View will show 937 National Listings.

But since you order your View by a custom field that does not exist for all of those National Listings - only the ones WITH that field will be shown in the View.
The field is "is it claimed".

Then you have a bulk of Filters in that View, as you can see it tells you to delete them:
This View has some query filters that are missing from the form. Maybe you have removed them:

All those filters are actually still active, and only if deleted will not affect this view.
I suggest to either delete them there or in a duplicate view, as stated initially.

If that does not help, every custom code like JS should be removed before further actions, so to be sure that is not affecting the output.

Your current View finds 15 items only, because of all those filters and Custom Field ordering where not all the National listings have that field.
I have duplicated you a view here hidden link sand performed the steps I suggested, so now if you insert that View to a page, it looks very different:
hidden link

==> Note, the biggest issue is the orderby your custom field, which seems to exist only for 15 posts (National listings), so there cannot be more posts found if you order by the field.
As you can see in my duplicate View I use the post date instead which always exists.

It may be that your import missed the field, adding it for each of the posts will solve the issue in the existing view too (or - order it by post date)

#1364681
listing.png

I switched the order to Random, this now means all posts are visible, which is great thank you.

However, I think there might be a problem with the content template. On display, very often in the thank-you field, it also shows the post relationship and relationship slug contents. I have no idea how this has happened, it's so odd.

What do you think might be causing this?

Many thanks,
Cat

New threads created by Beda and linked to this one are listed below:

https://toolset.com/forums/topic/issue-with-content-template/

#1366219

That should be an entirely different issue and requires a new ticket.
I have opened one for you here:
https://toolset.com/forums/topic/issue-with-content-template/

Thank you for understanding.

#1366471

My issue is resolved now. Thank you!