Saltar navegación

[Resuelto] Show child post id on parent php template

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
Show child post id on parent php template

Solution:
To get the related child post using PHP, you will require to use the function: toolset_get_related_post() [for single child post]
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post

OR
toolset_get_related_posts() [for multiple child posts]
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts

Relevant Documentation:
- https://toolset.com/documentation/customizing-sites-using-php/displaying-child-posts/#displaying-child-post-contents

This support ticket is created hace 3 años, 10 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
- 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 2 respuestas, tiene 2 mensajes.

Última actualización por aitorS hace 3 años, 10 meses.

Asistido por: Minesh.

Autor
Mensajes
#1962443
Captura de pantalla 2021-02-22 a las 10.49.20.png

I am developing a content template using PHP, in a section where I am developing a slider I would need to show the POST ID of the child CPT in the parent CPT template

#1962723

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To get the related child post using PHP, you will require to use the function: toolset_get_related_post() [for single child post] or toolset_get_related_posts() [for multiple child posts]
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post

Please check the following Doc that illustrates how you can display the custom field belongs to your child post:
- https://toolset.com/documentation/customizing-sites-using-php/displaying-child-posts/#displaying-child-post-contents

#1965703

My issue is resolved now. Thank you!