A hierarchical post type is a post type with a parent and one or more children. The pages post type in WordPress is a classic example of a hierarchical post type. One page can be the parent of other pages, that can be parents of other pages in a hierarchical fashion.
register_post_type() function is how we create custom post types in WordPress.
hierarchical
(boolean) (optional) Whether the post type is hierarchical (e.g. page).
Allows Parent to be specified.
Default: false
supports
(array) (optional) An alias for calling add_post_type_support() directly.
Default: title and editor
* ‘title’
* ‘editor’ (content)
* ‘author’
* ‘thumbnail’ (featured image, current theme must also support post-thumbnails)
* ‘excerpt’
* ‘trackbacks’
* ‘custom-fields’
* ‘comments’ (also will see comment count balloon on edit screen)
* ‘revisions’ (will store revisions)
* ‘page-attributes’ (menu order, hierarchical must be true to show Parent option)
* ‘post-formats’ add post formats, see Post Formats
‘hierarchical must be true to show Parent option‘.