Custom post type – order field

When declaring your custom post type using the register_post_type function, you have to add ‘page-attributes’ to the support field, like in the following example:

register_post_type('myposttype', array(
    'supports' => array('title', 'editor', 'page-attributes'),
    'hierarchical' => false
));

You’ll need to add any other supported meta boxes as well to the ‘supports’ field, see https://developer.wordpress.org/reference/functions/register_post_type/ for more information about the register_post_type fields.

Also as far as I know there isn’t any built in way to prevent two of the same order, this is because you can create sub-ordering based on heirarchy (so one group of children pages can have a different ordering than another)

Leave a Comment