Skip Navigation

[Resolved] Display parent field when showing single child post

This thread is resolved. Here is a description of the problem and solution.

Problem:
In a template that shows child posts, how to display the title (or other field) of the parent post?

Solution:
Insert the field in question using the Fields and Views button and use the Post Selection tab to specify which post should be the source for the field (e.g. the parent).

That will add an item attribute, something like:

[wpv-post-title item="@relationship-slug.parent"]
This support ticket is created 6 years, 1 month ago. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by marcJ 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1128920
Capture d’écran 2018-10-17 à 11.24.41.jpg

Hi, I try to build a very complicated site and I think Toolset (And Elementor Pro) is the the right tool for this. So I apologize in advance for over using this support.

I have created 2 CPT on my Site : "Section" and "Channel"
This CPT are Parent of Standard WP Post. And they ARE NOT RELATED BETWEEN THEM

I created a Single Post Template using Elementor Pro.

My Goal is to Display the parent of the actual single post the user are viewing. Please look the screenshot to understand What I need. I think I can display it using Shortcode but I don't find the good one. I can use PHP too directly on elementor using a plugin that display PHP via Shortcode.

#1129225

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2018-10-17 at 15.06.55.png

Hi there

When you use the Fields and Views button to insert a field, you can use the post selection tab to specify that the source for the field should be something different than the current post, e.g. a related post from a Types relationship.

See the screenshot for an example where I am inserting a field from the parent Project post.

That inserts the shortcode in this format:

[types field='departments' separator=', ' item='@project-task.parent'][/types]

Note the item attribute, which specifies the slug of the relationship and the part of the relationship, i.e. the parent, which should be the source for this field.

The problem you have working with Elementor is that we can't control the UI for Elementor templates and you don't have the Field and Views button available to you.

The shortcodes should still work in contexts where shortcodes are accepted (e.g. the text module or the shortcode module), but you need to enter the shortcode manually, or by copying and pasting from a backend edit screen where you had the Fields and Views button available.

#1129562

Ok I understand.

Maybe I miss something but How I know the name of the field ?

[types field='??'

This a slug ? or title ? And Where I can find it ?

#1129603

Ok thankyou

I finded the right short code who is :

[wpv-post-link item="@rel_boardpost.parent"]

Thank You for your help.

#1129609

My issue is resolved now. Thank you!