Support » Fixing WordPress » Limit children of Page in list

  • …searched and searched, can’t find it. I have a Page, and am listing the children of that page. This list will get too long eventually. I need to call only the latest 15 children of the parent. Right now I have:

    <?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 } ?>

    which is listing the pages nicely, but in some time, that list is going to get too long. Any way to limit it to the latest 15?

    thank
    JSC

  • The topic ‘Limit children of Page in list’ is closed to new replies.