[Resuelto] get all the varies post type children post of a parent based on parent id
This support ticket is created hace 3 años, 4 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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
-
10:00 – 13:00
10:00 – 13:00
10:00 – 13:00
10:00 – 13:00
10: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/Kolkata (GMT+05:30)
Este tema contiene 5 respuestas, tiene 2 mensajes.
a 'Plan" have multiple children from a few CPT's
e.g. a plan is a parent of budget, net worth and other custom post types
as far as I understand the current toolset_get_related_posts require a relationship to be declared. i understand that only one relationship can be called out.
is there a way to get all the children of the parent across multiple relationships
i.e plan_budget and plan_net and plan_target etc..
If you can share admin access details and tell me where you added the code I'm happy to review it.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I checked and I found that you are using the one-to-one post relationship.
So, rather making things complicated, you can use the Toolset post relationship API function: toolset_get_related_post() to get the related child post for every relationship you have.
The variable $related_assumption and $related_budget will hold the child post ID. You should get the post based on the found ID and display the content as required.
In your case its different. You have assumption and budget set as child. That is why we will have to use toolset_get_related_post() or toolset_get_related_posts().