Saltar navegación

[Resuelto] Linking Multiple Post Types

This support ticket is created hace 3 años, 6 meses. 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 -

Zona horaria del colaborador: Asia/Karachi (GMT+05:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por JoelK2744 hace 3 años, 6 meses.

Asistido por: Waqar.

Autor
Mensajes
#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

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.