Skip Navigation

[Resolved] Displaying related child posts of the same parent

This support ticket is created 4 years, 7 months 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.

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)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Shane 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1677749

Hello, I am trying to display related child posts belonging to the same parent.
I have this template displaying the Attractions (CPT) hidden link. At the bottom of the page, I have to display all attractions related to the same destination (parent) hidden link

The View I am working on is called Attraction - Sights & Activities.

I will provide login credentials if you need it.

What is the link to your site?
hidden link

Thanks

#1678321

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kenneth,

Thank you for getting in touch.

Yes please provide the admin access to the site so that I can check on the view to see why it is display No Results Found.

Thanks,
Shane

#1680625

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kenneth,

Thank you for the patience. I was able to find what the issue was and it was coming from the Post Relationship filter.

Assuming that you want to display the related attractions based on the Current taxonomy of the currently view Attraction as well as the Parent.

You will need to modify the Parent filter to be set by a shortcode parameter. You will need to do this because you are not able to get the Parent of the attraction automatically. You will need to manually tell which ID is the parent using this shortcode below.

[wpv-post-id item='@destination-attraction.parent']

I set the view to be filtered by a shortcode parameter so that I can pass this shortcode into the view. The final result will be like below.


[wpv-view name="attraction-sights-activities"  wpvrelatedto="[wpv-post-id item='@destination-attraction.parent']"]

I've set this up on your Attraction - Sights & Activities view and it should be producing your results. All you need to do is to apply this concept to the other views that are pulling similar data.

Please let me know if this helps.
Thanks,
Shane

#1681757

Thank you Shane, I applied your solution to other views in Tabs and its working like a charm. 🙂

#1682359

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kenneth,

Happy I was able to guide you through this.

If there are no further issues with this then you can go ahead and mark this ticket as resolved.

Thanks,
Shane