How to loop and display all parent post, then sort order that list by the date of the child post?
In a View, you can order by 2 arguments, a primary and secondary, but there is no orderby "the parent post".
As a possible solution, you can create a View, and query the Child Post Type.
Those you can order by their date in the orderby setting.
Then, in the Loop, you will have to call the related parent Posts.
What you can also do is create 2 Views, in one you query the parent post and order it by what you need, in the second View you query the Child posts (that are a child to the post in the loop).
Those you can order again as you need.
Then you insert the second View into the first's View Loop.
Then, the first View is inserted in a page, and will produce this sort of result:
- parent post (ordered by what you chose) -- child post (ordered by what you chose) -- child post (ordered by what you chose) -- child post (ordered by what you chose) - another parent post (ordered by what you chose) -- another child post (ordered by what you chose) -- another child post (ordered by what you chose) -- another child post (ordered by what you chose)
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)