Hi guys this looks doable but I cant quite figure it out. I have a lists of pages in wordpress
Page1
Page2
Page3
Page4
when you are on a page need to display it’s children but only it’s children and not the children of the other pages (which all have children)
Page1
Page2
-child1
-child2
-child3
--grandchild1
--grandchild2
-child4
Page3
Page4
I have checked the codex but I don’t think it does this?
Can anyone help?
Thanks
Jamie
You can also use wp_list_pages(‘childof=$parentPageID’);
Sure, you can do this with
get_page_children()
. It takes a parent page ID and an array of all pages and returns a filtered array that only contains the pages that are children of the parent page.