title: Wordpress - Limit get_pages to show 5 items
body: <p>How can I limit the get_pages to only show 5 items?</p>
  
  <p>I thought adding <code>'number' =&gt; 5</code> to the array would limit it to 5 but it doesn't show anything. Here's my code:</p>
  
  <pre><code>&lt;?php 
  $pages = get_pages(array('post_type' =&gt; 'page','sort_column' =&gt; 'menu_order','sort_order' =&gt; 'ASC','child_of' =&gt; 765));
  
  foreach($pages as $post)
  {
  setup_postdata($post);
  $fields = get_fields();
  ?&gt;
          &lt;p&gt;&lt;?php echo $fields-&gt;start_date; ?&gt; &lt;a href="&lt;?php echo get_page_link($post-&gt;ID) ?&gt;"&gt;&lt;?php echo substr($fields-&gt;event_title,0,24) . "..."; ?&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;?php
  }
  
  wp_reset_query();
  ?&gt;
  </code></pre>