4

Lets say I have created two custom post types A and B. Those post types are displayed in the Admin menu one after another. (After Posts for example)

Is there a way to display B under A?

The only similar behavior I am aware of is to assign Taxonomies to Post Types. This forces the first to be displayed under the second. I am looking for a way to do this using custom post types.

It's like having relationships across post types.

I am managing post types and taxonomies using the excellent GD CPT Tools plugin. Wordpress 3.4.2

10

Yes, this capability is available with register_post_type, via the show_in_menu argument, but whether or not the particular plugin you are using supports this I don't know.

add_action( 'init', 'wpa70679_custom_types' );

function wpa70679_custom_types() {

    register_post_type( 'parent_type',
        array(
            'public' => true,
            'labels' => array(
                'name' => 'Parent post type'
            )
        )
    );

    register_post_type( 'child_type',
        array(
            'public' => true,
            'show_in_menu' => 'edit.php?post_type=parent_type',
            'labels' => array(
                'name' => 'Child post type'
            )
        )
    );

}

Results

| improve this answer | |
0

Yes, if you are OK with using a (highly rated) plugin!

| improve this answer | |
  • Been searching about an hour for something like this :p – Odys Oct 27 '12 at 18:16
  • then there is your answer! – Gaia Oct 27 '12 at 18:18
  • I think this does something else than my question. This allows posts (of whatever post-type) to be reordered. What I am looking is a way to do this within post types. – Odys Oct 27 '12 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.