WordPress.org

Ready to get started?Download WordPress

Forums

Limit children of Page in list (1 post)

  1. jami1955
    Member
    Posted 3 years ago #

    ...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

Topic Closed

This topic has been closed to new replies.

About this Topic