2

I want to register a custom post type as child of another custom post type. I have 2 questions--

  1. hierarchical' => true should be added on the parent or child when register?
  2. Codex says "Allows Parent to be specified", how?
2

"Allows Parent to be specified" means that the post type behaves more like pages than posts.

What you are trying to achieve is not possible with core functions, but there's a plugin wich does almost the same.

I recommend you the powerful Posts 2 Posts plugin by WordPress Core Contributor scribu. It allows you to create connections between different post types and has lots of configuration possibilities. The screenshots and the documentation can give you an impression if it's right for your task.

|improve this answer|||||
  • Nice plugin, but a bit too heavy for me and I need to do a lot more specific tasks for my needs between the connections. Anyway, I'm going to study this plugin to get some ideas. Thanks! – Jenny Feb 23 '12 at 11:42
2

"Allows Parent to be specified" means that you can allow its child post types to call this post type their parent. This means you need to add

'hierarchical' => true

every time in the args of parent Post Type when you need children.

Look at this for making a 'Post Type' a child of another.

|improve this answer|||||

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.