Home / page / Display current page sub pages
  • How to Display current page sub pages

    no thumbnail sorry: Display current page sub pages

    Adding this wordpress code snippet to your page.php will display the current pages sub/child pages in a list.

    ( click code to copy )

    wordpress snippet : PHP

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

    ( WordPress codex functions, hooks, in this snippet. )

    wp_list_pages, menu_order, wp,