[Resolved] View not showing posts

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

Last updated by Luo Yang 7 months, 2 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#1317493

This is a furniture site. i used views to create archives for each category and subcategory.

Under mattresses, there is a category called tempur-pedic. It has one post, but the view that should be displaying it come up with no results. I have tried recreating the post (and checking that it is published). i've recreated the view, i have recreated the category, but no matter what, the post will not show up on the page.

the post in question is hidden link, which should show up on hidden link

#1317533

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

How do you setup the post view(ID: 11845)?
How do you setup the problem post "Tempurpedic Current Inventory"?
can you take a screenshot for them?
If you are using option Order by a custom field, you will need to make sure all posts have value in that custom field.

See WordPress document:
https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
section "Order & Orderby Parameters":
‘meta_value_num‘ – Order by numeric meta value (available since version 2.8). Also note that a ‘meta_key=keyname‘ must also be present in the query.

#1318059

The posts are a custom post type called furniture, with a custom hierarchical taxonomy of Furniture Categories.

The post in question has been assigned the category of Mattress, and sub category of Tempur Pedic.

The view is set up with a content filter for the tempur-pedic category. I tried duplicating one of the views from the other mattress brands and changing the filter to mattress, or tempurpedic, and the post in question did not appear in either scenario.

I am sending 4 screen shots

1. view setup
2. Post (Tempur Pedic Current Inventory) from front end
3. Post from back end
4. Category view page from inside the Divi Builder

#1318095

I found it. The sorting order is set up for the price, which was left blank. Thanks for the help

#1318683

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

As I mentioned above:
https://toolset.com/forums/topic/view-not-showing-posts/#post-1317533

If you are using option Order by a custom field, you will need to make sure all posts have value in that custom field.

In your screenshot:
https://toolset.com/wp-content/uploads/2019/08/1318059-view_setup.jpg
you are sorting the result by custom field "queen-sized-price".

But in single post:
https://toolset.com/wp-content/uploads/2019/08/1318059-post_backend.jpg
there isn't value in field "queen-sized-price".

So it conducts the problem you mentioned above, since Views is using WordPress class WP_Query to query posts, this is a limitation of WP_Query, see the document I mentioned above:
https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters

Please add a value into field "queen-sized-price" and test again.