Passer la navigation

[Résolu] Cannot display parent's post content body at front end

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

I have a post type 'project' with is a child of post type 'customer' (parent).

parent post content body does not show

Solution:

Would you please use the fields and text block instead for the content of the parent body and add the code below there?

[wpv-post-body view_template="None" item="@thecontent.parent"]

Replace "thecontent" with the slug of the relationship

This support ticket is created Il y a 2 years, 2 months. 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.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par dorotheeD Il y a 2 years, 2 months.

Assisté par: Christopher Amirian.

Auteur
Publications
#2693244
parent-child body content.png

Hi,

I have a post type 'project' with is a child of post type 'customer' (parent).

At front end, i want to show
- child post content body (using 'single field') > OK
- parent post title > OK
- parent post content body (another single field) > problem

In the Toolset content template, it's showing up as expected (see image). However, on front end: no parent post content body.

Example: lien caché

Am I missing something?

Thanks in advance

#2693402

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi there,

Would you please use the fields and text block instead for the content pf the parent body and add the code below there?

[wpv-post-body view_template="None" item="@thecontent.parent"]

replace "thecontent" with the slug of your parent field in the code.

Thanks.

#2693564

Hi Christopher,

Using the parent's slug did not work, but using the relationship slug did. So, i'm happy, it works now.

Thanks,