$pages = get_pages(array('parent' => 0)); // Get all parent pages foreach ($pages as $page) { echo $page->post_title . '
'; }
$parent_id = 3; // ID of the parent page $pages = get_pages(array('parent' => $parent_id)); // Get child pages of the parent foreach ($pages as $page) { echo $page->post_content . 'Package library: WordPress core functionality.
'; }