Skip Navigation

[Resolved] Relationship between two custom post types

This thread is resolved. Here is a description of the problem and solution.

Problem:
Want to create a relationship between Event post type (Event plugin)and Speaker post type.
Solution:
https://toolset.com/forums/topic/the-events-calendarmodern-tribe-custom-post-types/#post-391394

https://toolset.com/forums/topic/the-events-calendarmodern-tribe-custom-post-types/#post-391465
Relevant Documentation:

This support ticket is created 7 years 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Frank Hackenbuchner 7 years ago.

Assisted by: Noman.

Author
Posts
#585857

Hi,

our site is still under construction. However, we are looking for a solution to combine two custom post types.

I.e. we have one post type Events and one Speakers. On the single view site of each event, we want to show a list view of all speakers who hold a discourse on this event.

How we can make such a relationship in backend (custom fields?) and frontend (view)?

Thanks for a solution!

Frank

#585966

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Post relation.png

Hi Frank,

Thank you for contacting Toolset support. I see you would like to create a relationship between Event post type and Speaker post type.

Go to Toolset >> Post Types >> Events (Parent CTP) >> Children Post Types >> Select Speakers (Child CPT) >> Save. See attached screenshot.

When we define relationship it will automatically add custom field in child CPT to make a relation
then using view we can display speakers in Event single page

Please refer this doc as well Creating Post Type Relationships:
https://toolset.com/documentation/user-guides/creating-post-type-relationships/

Thank you

#586091
Event.png
Parent.png

Hi Noman,

thanks for fast replay! However, there is a little problem. The Event Post Type comes from an Event PlugIn not from Toolset. So, it's not in the Toolset Post Types list.

I tried to select the Speakers (this is a Toolset Custom Post Type) an selected there "Parent Post Type" Event (here the Events shows up) - see attachment.

Now going back to the Event posts there is in deed a section for the speakers, but I only can add a new speaker, There are already a lot of speakers we have registered.

Is there any way to solve this and get access to the speakers list in the Events Post section?

Thanks again,

Frank

#586562

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Okay, we have another client who had the similar issue and luckily was also able to solve it, this may help in your case:

https://toolset.com/forums/topic/the-events-calendarmodern-tribe-custom-post-types/#post-391394
https://toolset.com/forums/topic/the-events-calendarmodern-tribe-custom-post-types/#post-391465

Thank you

#590314

Thanks for this links. We try some solutions. But because we need a many-to-many relation we will wait until the Types update with the relation manager.