Solution to Custom Post Type Parent Drop Down Is Missing
-
Hi All,
Some hints for anyone wondering why, when adding a new post for their own custom post type, there is no drop-down menu list on the right-hand side to elect another post to be its parent. In my experience (and there may well be other circumstances) the box will appear only…
1. …when you have already added at least one post for the respective post type, and you are now adding a second/third/etc. NOTE: if you have already created at least one ‘normal’ post, and now you’re adding you first custom-type post (e.g. ‘Event’), know that a ‘normal’ post cannot be the parent of a custom-type post (and vice-versa).
2. …when you have added the necessary support (i.e. the ‘page-attributes’ element in the array) in your theme functions.php file.
E.g.
add_action(‘init’, ‘create_my-custom-post-type’);
function create_my-custom-post-type() {
$my-custom-post-type_args = array(
..etc…
‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘page-attributes’)
);
register_post_type(‘my-custom-post-type’,$my-custom-post-type_args);
}(There are myriad resources on functions.php if you need more in-depth guidance.)
Hope this helps.
- The topic ‘Solution to Custom Post Type Parent Drop Down Is Missing’ is closed to new replies.