• this code lists the pages even if on the subpage, but not the ancestor

    <?php
      if($post->post_parent)
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      else
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      if ($children) { ?>
      <ul>
      <?php echo $children; ?>
      </ul>
      <?php } ?>

    I need the ancestor to be listed too, not only it`s child pages

    thank you

  • The topic ‘list pages even on a subpage, but ancestor too.’ is closed to new replies.