Hi,
Thank you for sharing the admin access.
First, I apologize for the delay, as we had an unusually busy queue before the weekend.
Although the user name and password to access your website's admin area, didn't work, I was able to make this work on my test website.
Here are the steps:
1. For my "Coaches" post type, I added a numeric type custom field with slug "superior-id". I also set the field to save '0' as a default value, which will be used for the grandparent items, like "1 Master", "2 Master" etc.
( screenshot: hidden link )
For all other child items, this field will hold the post ID of the parent item.
2. Next, I created a post view named "Parent Coaches View", which would be used to show only the grandparent items.
The view was set to show "Coaches" posts, ordered by "Title" and with a query filter for the "superior-id" field where the value is equal to '0'.
( screenshot: hidden link )
In the loop in "Loop Editor" section, I included only the title:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<ul class="wpv-loop js-wpv-loop">
<wpv-loop>
<li>
[wpv-post-title]
</li>
</wpv-loop>
</ul>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
When inserted on a page, this view shows all the grandparent posts.
( screenshot: hidden link )
3. The next step was to create another post view "Child Coaches View", which would recursively show the child items of the grandparent items.
This view was also set to show "Coaches" posts, ordered by "Title" and with a query filter for the "superior-id" field where the value is equal to the value passed through shortcode attribute "parent".
( screenshot: hidden link )
In the "Loop Editor" section, I included the title and the shortcode for this same view, so that it can loop through all the levels down. That shortcode also included the ID of the current post in the loop, passed as the attribute "parent":
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<ul class="wpv-loop js-wpv-loop">
<wpv-loop>
<li>
[wpv-post-title]
[wpv-view name="child-coaches-view" parent="[wpv-post-id]"]
</li>
</wpv-loop>
</ul>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
4. The last step was to include the shortcode of this child view in the loop of the parent view as well.
( screenshot: hidden link )
And here is the screenshot of the final output of these views from the front-end:
hidden link
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar