Sauter la navigation

[Résolu] display parent post title

This support ticket is created Il y a 4 années et 4 mois. 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Marqué : 

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

Dernière mise à jour par davidm-13 Il y a 4 années et 4 mois.

Assisté par: Shane.

Auteur
Publications
#1753043

Hi,
Have a View displaying fields from a child post, including the parent-id (wpcf-species-id) this is the content template of the Loop output of child posts

<p>
  Plant ID: [wpv-post-field name='wpcf-species-id'] 
  Plant Name: [wpv-post-title id="$plant"]  <!-- This field does not display -->
   Complaint:  [wpv-post-taxonomy type="complaint-use" format="slug"]
  System: [wpv-post-taxonomy type="system" format="slug"]
  Action: [wpv-post-taxonomy type="action-medicinal" format="slug"]
</p>

The Plant Name from the parent post does not display
How do I display the parent post title? The wpcf-species-id is common to both the parent post and it's children

#1753919

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi David,

In a case like this you will need to use the item attribute. We no longer use the ID attribute to specify which post information to display.

You can try doing this.


[wpv-post-title item="@{relationship-slug}.parent"]

Where you will replace {relationship-slug} with the relationship slug defined in Types->Relationship and edit your relationship to find the slug.

For more information on the item attribute you can check the link below.

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

Please let me know if this helps.
Thanks,
Shane

#1754051

Thanks for this Shane worked almost out of the box.
Took me a few minutes to work out to remove {}.
So it was

[wpv-post-title item="@relationship-slug.parent"]

Guess the curly brackets are there to indicate that part needs to be replaced.