I have a page with id 63. That page is having a number of child pages and each of the child pages is again having sub pages. In short page with id 63 is super parent to all the pages.
What I want is, I want to check whether the current page is a child of page with id 63. Either a direct child/child of child up to any level.
I am able to check the whether the page is a child of page 63. But not able to check the same for child of child pages.
I am using $post->post_parent == 63
to check whether the page is a child of page 63.
How can I check the same for all levels of pages ?
You can use get_post_ancestors() like this: