Skip Navigation

[Resolved] Child Posts Without A Parent?

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by julieP 6 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#920840

I have a scenario where I'd like Post B to be a child to Post A (in a one-to-one relationship). However, where my users are concerned, there are a couple of scenarios:-

1. they may not want Post A (ever)
2. they may want Post B first and want Post A later on

So my question is: can Post B be created without selecting a parent and how?

If this is possible, how can I create the association (without manually doing this in wp-admin) if they create Post A after Post B?

Many thanks

#921108

Hello,

Q) can Post B be created without selecting a parent and how?

Yes, it is possible, you can create the post B in wordpress admin side, or using Toolset form in front-end

Then you can setup a relationship form, and connect the post A with post B in front-end, see our document:
How to Build Front-End Forms for Connecting Posts
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

#921153

Hi Luo

A little puzzled: if a user creates Post B first, there won't be a parent available to associate it with so what do I do with or to the parent selector in the form that creates Post B?

I've looked at the link you provided but it talks about connecting posts in a many-to-many relationship (my scenario is a one-to-one)??

#921186

In the new post type relationship of Toolset plugins, there isn't parent/child post type relationship (concept) any more, it is replaced with one-to-many relationship, you can consider it as a special many-to-many relationship, and one-to-one is a special one-to-many relationship.

The relationship form is for connectting the existed posts with other existed posts.

In your case you can try one of below options:
1) setup a relationship form to connect post A and post B
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/
2) Setup a post editing form to edit the post B, use it to connect post A

#922338

I disagree with your comment about there not being a parent/child 'concept' anymore; it's exactly what a one-to-many relationship is, toolset still uses 'child' and 'parent' in selectors and if using the words 'parent' and 'child' is the clearest way of explaining which side of a one-to-many relationship I'm referring to then I will continue to use them.

You still haven't explained how Post B can be created without selecting a parent but the documentation you've linked to is so complicated and the solution is IMHO cumbersome and not worth it for my requirement so I've found another way to achieve what I wanted.