On my client's website that we are building in a sandbox, I have set up a many to many relationship using an intermediary custom post type. We are using Woocommerce and the products are Machines. The three CPTs are Companies, Contacts and Ownership (the intermediary post type).
(fyi but not relevant: we have injected the company and contact post types with the WooCommerce product taxonomy using code in the functions file)
Companies own Machines. Contacts are children of Companies. So the Company CPT is the parent of the Contact CPT and the Ownership CPT.
When I edit an entry in the Company CPT, in the "post relationship" meta-box, I properly get two elements: contacts and ownerships. I can add a new contact without issue so I can have multiple contacts associated with the company. I need to be able to assign multiple machines to accompany under the "ownerships" type, but when I add a new ownership, it blanks out the previous one. I've attached a screenshot of the Post Relationship meta box.
How can I have multiple machines and multiple contacts associated with the company?
Thanks!
As far I see, you have the Post Type " Company", that has 2 Child Post Types, the "Contacts" and the "Ownerships".
So, when you edit a Company, save it, you can add those as child Posts, as you show me in the Screenshot.
This works fine.
There will be no greyed out posts, those will all be listed as Childs in that metabox.
Could you show me what you mean with "it blanks out the previous one"?
I cannot replicate this.
I'm all set. This was the case of the parent needing to be saved before children can be added.
Thank you.