The WordPress get_pages function works similar to the get_posts function which fetches posts from the database by criteria. The get_pages function takes different arguments and allows you to take control of parent and child pages as you execute the function.
<?php $pages = get_pages($arguments); ?>
<?php $arguments = array( 'child_of' => 0, 'sort_order' => "DESC", 'sort_column' => "post_title", 'exclude' => "3,7,8", ); $pages = get_pages($arguments); ?>
The ID of the parent page. Allows you to fetch child pages of a specific parent page. Use 0 or null or false in order to fetch all parent and child pages.
The direction in which the results should be sorted. This can be either ASC or DESC. Works in conjunction with the $sort_column parameter explained below.
The database column to order by. Makes use of the $sort_order parameter explained above.
Comma delimited list of page IDs to exclude from the results
Comma delimited list of page IDs to include into the results
Comma delimited list of the authors to which the pages belong. Only pages created by these authors will be included into the results
Matches a specific meta key and only includes those pages into the results
Matches a specific meta value and only includes those pages into the results
If set to 1, pages will be fetched in a hierarchical mannerÂ