How to display child page from specific parent page in homepage?

This should do it.

<?php
  $pages = get_pages('child_of=199');
  foreach($pages as $child) {
?>
  <h3><?php echo get_the_title($child->ID); ?></h3> 
<?php 
  // This next line gets the full page of content
  // echo get_post_field('post_content', $child->ID);

 // This next line will cut the content off at 450 letters
  // With a read more link under it 
  echo '<p>' . substr(get_post_field('post_content', $child->ID), 0, 450) . '</p>'; ?> 
 <a href="https://wordpress.stackexchange.com/questions/49666/<?php echo get_permalink( $child->ID ); ?>"> READ MORE </a> 
<?php } ?>

Change “child_of=199” with the ID of the page you want to get the children of.

There is a line that is commented out, that line will get the full page of content

The line that is being used to get content will only get the first 450 letters.


There has to be a better way to get content, as this pulls in the HTML and all – so if that first 450 letter happens to land in the middle of a image you will have broken text.

I am sure a quick google search of “get post content by Id” should help with that part