Viewing 4 reply threads
  • Author
    • #10892

      Hello everyone 🙂

      How do you enable page attributes with a custom post type so that you can select the parent page?

      Also, is there a way to add a select field in a metabox that is populated with a specific custom post type (basically how the parent select works in Page Attributes, but limited to a post type)?

    • #10893

      @guit4eva– To answer both your questions:

      1) Pages are an “hierarchical” post type. You would set to true:
      hierarchical => true


      2) I suggest you base your field off of this tutorial. It’s pulling menu items, but you can easily change to your post type:

      Let me know if you still have questions.

    • #10894

      Hi Steve,

      Thanks for your reply. I’ve set hierarchical to true, but only the menu order is showing (and not the parent dropdown). I’ve also followed the tutorial you linked, but am unable to get the custom post type pages to show up. This is what I have so far:

      $post_types['establishment-option'] = array(
        'labels' => piklist('post_type_labels', 'Establishment Options')
        , 'title' => __('Enter a new establishment option Title')
        , 'supports' => array(
            , 'editor'
            , 'post-formats'
            , 'page-attributes'
            , 'thumbnail',
        , 'public' => true
        , 'admin_body_class' => array(
        , 'hierarchical' => true
        , 'has_archive' => true
        , 'rewrite' => array(
            'slug' => 'establishment-option',
        , 'capability_type' => 'post'


      piklist('field', array(
        'type' => 'select'
        ,'field' => 'sidebar_left'
        ,'label' => 'Establishment'
        ,'value' => 'none'
        ,'choices' => array(
            '' => 'Select Establishment'
          + piklist(get_posts(array(
            'post_type' => 'establishment_type'
            ,'hide_empty' => false

      Can you see where I might be going wrong?

    • #10895

      Just a quick update:

      The “Parent” dropdown in Page Attributes is showing up now – I had to add more pages to that custom post type (I misunderstood how it works – I thought you could add a parent from any custom post type).

      I also made an error with this part: 'post_type' => 'establishment_type', it should just be 'post_type' => 'establishment'. All is working correctly now. Thanks so much for the help, it’s all making a lot more sense now!

    • #10896

      Nice job! Happy to help.

      If you are happy with the plugin and the support, and you have the time, we’d appreciate if you could leave us a review on It really helps the project:

Viewing 4 reply threads
  • You must be logged in to reply to this topic.