Part 1
To loops through parent pages and child pages you need a recursive funtion. Luckily goldenapples has written one: https://wordpress.stackexchange.com/a/13678/1878
Part 2
That takes care of that but you still want to be able to order it, so WordPress allows us to set a Page Order. If you go into the edit page screen you will see under the Attributes box a spot for order. You can also set the order in the quick edit screen.
And then we need to tell the loop for orderby that order:
<?php
$args = array(
'post_type'=> 'people',
'orderby' => 'menu_order',
'posts_per_page' => -1 );
?>
Related Posts:
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- Automatically create child pages when saving a (parent) page
- Display a list of child posts on parent posts of a custom post type
- 404 on child page when parent page slug is identical to custom post type
- Create child page within custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Query in a Hierarchical Custom Post Type for Children vs Siblings
- Child page in custom post throws 404 page not found
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- Remove custom post type slug not working for child pages
- Share parent path between Custom Post Types and Pages?
- Page as a child of a Custom Post Type
- Can I make WordPress use a custom template for a child page
- Custom rewrite rule for hierarchical custom post type
- List children on child post
- child of post type (custom)
- Child post with numeric only slug keeps redirecting to parent
- Next and Previous Posts of Same Parent
- Display Child Pages of Custom Post Type Parent Page
- Versioned Custom Post Type (Not the same as revisions)
- Custom post Type, child of a Page?
- What code should I use to display children of a custom post?
- Removed custom post type slug but not working for child pages
- List of child custom post types lists all custom post types
- Redirect to first child on Custom Post Type (without template)
- Query to get child pages of current page and display it in action hook
- If/Else child list for Custom Post Type single template within loop?
- Migrate Custom Post Type with Custom Fields data and parent child order
- How do I find out which (page) template file my custom child post is looking for?
- How to use POST method using custom wordpress button?
- Standard Page Child of CPT Not Found (404)
- Display a list of sub-pages of Custom Post Type Parent Page
- I have a problem with displaying children pages of custom post type
- WordPress custom post type and page
- Child Theme problems
- Custom post type child page 404
- Custom Post Type Child Pages
- How can I give WordPress child custom post type the same title and slug as its parent?
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- Custom post type yearly/ monthly archive permalinks
- Restrict custom post type view by user role
- Changing the priority of a custom taxonomy’s metabox
- Adding post tags to custom post types
- How to show more posts on an archive page?
- Pagination not working with custom category template
- Multiple post types in archives (filter?)
- Metabox saving values
- Function like in_category for custom taxonomies
- custom search result page
- Missing Title on custom post types
- Pagination not working
- Should I use Custom Post Types or something else
- Hyphens instead of Underscores in Post-type Archive Template Filenames when Post-type handle contains underscore
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- I changed post_type and now I receive 404 errors
- How to retrieve a custom post’s capability?
- How to make a relation between two posts
- permalink editor doesn’t show on custom post types
- Common categories for two custom post types
- Custom Post Type using single.php is looking for a template that doesn’t exist
- Email notification via WP_Mail on published custom post type
- How to store multiple values in 1 meta_key with radio input?
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- Custom taxonomy rewrite give pagination 404
- Custom Post Type not showing in Rest API on Multisite
- Rewrite rule for Custom post type Monthly and Yearly archive
- Custom post type’s extra fields – how to handle?
- Is there a way to exclude posts based on meta_values?
- Conditional for post type inside loop (recent posts)
- get_post_types is not showing all registered posts
- Conflict between Capabilities and Menu Visibility with Custom Post Types
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Show current custom taxonomy
- finding and using post type fields in WordPress
- `save_post` hook called on inserting new post from front end
- Custom capabilities not reflecting on admin panel
- Query custom posts of logged in user only
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- WordPress is ignoring my post rewrite rule
- Update value inside array update_post_meta
- Search custom type post
- Basic CPT Question About Categories
- How to upload an image to a custom post type
- Attach a post type to other one
- Creating a custom WP query for a Custom Post Type
- Get queried object for custom post type count
- Post Attribute Section missing for Custom post type
- How to order multiple custom post types with same taxonomy by date
- Ajax load more inside custom post type taxonomy
- Insert a hash into the url of custom posts to make them function as anchors
- Create a custom wp_query from a specific custom post type with specific taxonomy
- Custom Post Type duplicating slug for new posts
- Show posts for current taxonomy
- Cannot retrieve Custom Taxonomies (Disappeared)
- Custom Post type and Taxonomy in post URL error
- Stop Custom post type from being searched via URL
- Multiple Custom Post Type permalink issue
- Post Meta rows from other types being added to DB regardless of post type
- Display Custom Post Type on Toolset Types Plugin
- How to consume external API from WordPress post editor and display the response data in the custom field?