You need to set both of these things to make it work correctly:
register_post_type( 'docs',
array(
'labels' => array(
'name' => __( 'Documentation' ),
'singular_name' => __( 'Documentation Page' ),
'add_new' => __( 'Add Documentation Page' ),
'add_new_item' => __( 'Add New Documentation Page' ),
'edit_item' => __( 'Edit Documentation Page' ),
),
'public' => true,
'has_archive' => true,
'rewrite' => array( 'slug' => 'docs' ),
'show_in_rest' => true,
<strong>'hierarchical' => true,
</strong> 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', <strong>'page-attributes'</strong> )
)
);Code language: PHP (php)
Now when you are on the Create/Edit screen for the new Post Type, you’ll see the Page Attributes area that allows you to select the Parent you’d like.

Thoughts?
Email me or comment below.
Also CodePen PRO is quite a deal. 🙏
I followed a guide to create custom post types with a plugin on my site, but I did not know about the possibility of making the hierarchical. May have to make use of this – thank you for the guide.