Title: &#8216;Function Get Pages&#8221; help please :)
Last modified: August 19, 2016

---

# ‘Function Get Pages” help please :)

 *  Resolved [Andrew](https://wordpress.org/support/users/andrewjohnstrong/)
 * (@andrewjohnstrong)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/function-get-pages-help-please/)
 * Gday,
 * I am attempting to have a parent page display $more content + link to full content
   of all children pages.
 * I found the following code (below) from here [Codex -Function Reference/get pages](http://codex.wordpress.org/Function_Reference/get_pages#Displaying_Child_pages_of_the_current_page_in_post_format)
   but it doesn’t quite do what I’m after.
 * I need help adjusting the below code to:
    - only output $more content of children pages + title + read more link (at the
      moment it outputs all content of the child pages)
    - only output children pages of the “Gallery” page id=88 (for some reason it
      is including content of another non related page
    - output all children pages of the parent, not just 2.
 *     ```
       <?php
                   $pages = get_pages('child_of=gallery'.$post->ID.'&sort_column=post_date&sort_order=desc');
   
                   $count = 0;
       			$more = 0;
                   foreach($pages as $page)
                   {
                       $content = $page->post_content;
                       if(!$content)
                           continue;
                       if($count >= 2)
                           break;
                       $count++;
                       $content = apply_filters('the_content', $content);
                   ?>
                       <h3><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h3>
                       <?php echo $content ?>
                   <?php
                   }
               ?>
       ```
   
 * Help would be greatly appreciated.
 * Cheers

The topic ‘‘Function Get Pages” help please :)’ is closed to new replies.

## Tags

 * [get pages](https://wordpress.org/support/topic-tag/get-pages/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Andrew](https://wordpress.org/support/users/andrewjohnstrong/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/function-get-pages-help-please/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
