Hi,
I have a site with the following 3 custom post types - Books, Online Courses & Personalities. All of these can be categorised with the default 'category' filter.
I have created views to show (a) books linked to a category (b) online courses linked to a category and (c) Personalities linked to a category. While the first 2 work fine, the personality view shows 'no items found' -- even when there are clearly items in the personality.
The views are identical (with the exception of the custom post type that it display), and were created by duplicating the views. When I go to a specific personality, that personality displays properly (so it is not an access issue, and access has not been used on any of the custom post types). Additionally, if I click on the category link displayed on the personality, it goes to the proper category archive (showing that the personality content is created, is visible and is linked to the category correctly).
In fact, there is also a category archive view that I have, which has a drop-down filter for custom post types (I have done a workaround to make this work, by having a select field in each custom post type that is the same as the custom post type name). Only books and online courses show up here. It is important to note, that this view was working perfectly fine, and all 3 custom post types were showing up. However, after enabling pagination on this view, and move around a few pages, personalities displayed from the view and is no longer showing up in any views that I create to display a list of personalities.
Do you have a link where I can see this?
It seems something related to the pagination, as you outline.
Eventually, I can spot it by looking at it as well in the backend, if possible.
I will look deeper into this on Tuesday, but for now, I saw you order those views by non-standard fields (such as Ranking Criteria.
Note that posts must have values in the fields you order by - as otherwise, the view would return empty.
Do all posts feature that field value?
Also, all posts must feature Categories the same as the current archive page AND Tags the same as the current archive page
is this the case?
I will make more tests myself as soon I am back on shift Tuesday
Hi Beda,
Thanks a lot for the prompt response on a weekend. I was using a sorting on 'ranking criteria' which was not a field that was present in the personality type. On changing the sort criteria, the information has started to show up.
I am keeping this ticket open for now, as I do further testing. Will let you know if it gets resolved.
Yes, that's what I suspected.
It is expected as in a Query that orders by some data, that data must be present.
If it's not present the resulting list of items that have no such data will not appear (it is excluded, as there is nothing to order by)
You should theoretically be able to solve this by adding the value to each post - for example, you can make the field required if it's a Types field, and with that you grant its existence.
Unfortunately, there is no way to avoid this when you query by that data, means if you use a certain data set to order then that data must exist for all the posts you expect to be returned.
My issue is resolved now. Thank you!