Child Page
PermalinkDoes anyone know of a good way to determine if the current page is a child or descendant of page x? For instance a function that would return true when the current page exists at /page-x/child or /page-x/another-page/descendant.
This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.
fetches cIDs of cParentID until it hits one.
Where that even matters is you can array_intersect or simply a in_array of whatever value that is good for.
You could use the intersect to mark parentIDs in say a 5 deep autonav is being(active) or whatever to show you are under that page.
Hope that helps.