get_pages( array( 'child_of' => $post->ID ) does not show all children

admin

Administrator
Staff member
I am pretty new to wordpress, and wondering if someone could shed some light on this code.
I am trying to list all sub pages on their parent page, here is the code with some html stripped out:

Code:
<?php
$mypages = get_pages( array( 'child_of' => $post->ID ) );

foreach( $mypages as $page ) {      
    $content = $page->post_content;
    if ( ! $content ) // Check for empty page
        continue;

    $content = apply_filters( 'the_content', $content );
?>

<p style="color: white; text-transform: uppercase;"><?php echo $page->post_title; ?></p>

<?php
   }   
?>

The code works, and correct sub pages are displayed - but not all of them. The 7 oldest posts are showing, but none of the newest pages that I created this week. I have checked and double checked that all new and old pages are the same in every way - same template, same parent page, same creator, same order number, and all published. Anyone have an idea of what I could be doing wrong?