$page->isAncestorOf($child)

Checks if the page is a direct or indirect ancestor of the given $page object

  • $child (Page | string)
  • return (boolean)

Example


<?php if($page->isAncestorOf('some-child-page')): ?>
This page is an ancestor of the given page.
<?php endif ?>

Is something missing or incorrect? Edit this page on Github…