Hi, you can create a View of grandparent posts and apply a Query Filter to limit the results as needed. Then nest a View of parent posts inside that View, and nest a View of child posts inside the parent post View. This approach works best when there are no front-end filters and pagination and loop indexes are not required.
You can create a custom shortcode using the post relationships API, allowing you to test for a specific grandparent post ID using conditionals. I can show you some examples if needed. This approach works best when pagination and loop indexes are not required, but works fine with front-end filters.
If pagination or loop indexes are required, then you must create a custom shortcode that produces a comma-separated list of child post IDs for a given grandparent post ID. Then add a post ID filter to a view of the child posts, set by a shortcode attribute. You can apply any other front-end or backend filters as well. Use your child post IDs View to set the value of the post IDs shortcode.
thank you! yes, can you please provide an example? i would need to be able to sort the table by column headings, and i don't think pagination is needed but i may need a text search on the front end.
Christian is currently unavailable as he is ill, however he should be back to continue with you here.
It is possible to create a sortable table with views when using the Loop wizard and selecting the table and then selecting the "Make Table header sortable option". See Screenshot.
Hi sorry I was unavailable yesterday. Following up on what Shane said, you can create sortable table columns in Views. However, as we are discussing in another ticket, there is a limitation when displaying information from related posts. It is not currently possible to sort effectively on any criteria from related posts, or to sort by any shortcode that requires an attribute.
Here's an example of a shortcode that will return a grandparent post ID, given a post ID and the two chained post relationship slugs:
I'm not sure if I solved the problem or ended up changing course - but what's working for me is a query filter based on a relationship, with the 'specific' grandparent chosen. thank you!