Skip Navigation

[Resolved] Linking Multiple Post Types

This support ticket is created 2 years, 3 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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by JoelK2744 2 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#2266677

Hello,

I would like to create a relationship between multiple CPTs but from what I can gather post relationships seem to be limited to 2 CPTs?

I have 3 different CPTs, let's say "CPT-1", "CPT-2" and "CPT-3".

I am planning to create another new CPT called "Offers".

I would like to be able to link an "Offer" to multiple CPTs and vice versa. So for example, I have an offer called "Offer A", I would like to be able to link it to a post in "CPT-1", a post in "CPT-2" and a post in "CPT-3". And these posts may be linked to multiple "Offers".

Is this possible? Or would it be case of setting up a number of separate many-to-many relationships?

Essentially what I would like to do is have the "Offers" show up on the single post pages for "CPT-1", "CPT-2" and "CPT-3" (using the example above "Offer A" would show on the linked post in "CPT-1", the linked post in "CPT-2", and the linked post in "CPT-3"). And then the single post page for "Offer A" would show the linked posts from "CPT-1", "CPT-2" and "CPT-3").

Hope that makes sense.

Many thanks,

Joel

#2268075

Waqar
Supporter

Languages: English (English )

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

Hi Joel,

Thank you for contacting us and I'd be happy to assist.

Your understanding is correct and to achieve this, you can create many-to-many relationships between the "Offers" and the other CPTs.

- CPT-1 <-> Offers
- CPT-2 <-> Offers
- CPT-3 <-> Offers

This will allow you to show the related offers on each single post page of those other CPTs ( i.e. "CPT-1", "CPT-2" and "CPT-3" ).

regards,
Waqar

#2271107

Thanks Waqar for confirming the correct approach to take.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.