wp parse args – Query posts(CPT, pages , hierarchical) by Ancestor ID

Question

so i have a custom post type with hierarchical structure. Looks like this:

top level 1
   - child 
      -- grand child
      -- grand child
   - child
      -- grand child
top level 2
   - child 
      -- grand child
      -- grand child
   - child
      -- grand child
top level 3

and so on.

I need a query with top level id as a base and query through all child and grand child pages of that top level page?

I know ther is post_parent arg, but it wont query grand childs…
I know I can second query childs for grand childs… but i dont want that. I need 1 query with all the other parameters, and with proper pagination count.
any ways to achive that?

thanks

0
Piotr 4 weeks 2021-08-23T07:55:35-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse