filter default query to show just selected level of child pages in wordpress
So it looks like get_ancestors() is the function you need to be able to figure out what ‘level’ something is. The number of results returned from get_ancestors corresponds to your ‘level’ number, with 0 results meaning parent page. And so the problem you have is that this number isn’t available as a query argument. Therefore, … Read more