Skip Navigation

[Resolved] How do i list child post on a stand alone page – not the parent post

This support ticket is created 5 years, 5 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
- 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 1 reply, has 2 voices.

Last updated by Nigel 5 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1116908

Tell us what you are trying to do? I would like to list all child posts (title and link) of a parent post on stand alone page.
the user view a parent post with a link to see all child posts
the user click on a the link and go to a page where all the child posts are listed
the user can select any of the child post link and redirected to the child post image gallery

Is there any documentation that you are following?
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/
the instructions are not clear enough. it will be great to see a video on your YouTube channel

Is there a similar example that we can see?
not sure

What is the link to your site?

#1117022

Nigel
Supporter

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

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

Screen Shot 2018-09-28 at 09.28.08.png

Hi David

Let's work backwards.

You are displaying child posts.

So create a View to list child posts. It sounds like it should output the child post title as a link.

Now this View will list *all* child posts, so we will need to add a Query Filter to limit the results to only those which are children of a particular parent post.

Which parent post?

One that we will pass to the View using a URL parameter.

In the screenshot you can see me adding such a filter. Views is suggesting "wpv-relationship-filter" as the URL parameter, but I could change this to something else if I wanted.

Add this View to a page. Note the ID of the page.

Now edit the template for displaying parent posts, where you want to insert a link to this page to list its child posts.

Insert a link to that page like so:

<a href="[wpv-post-url item='204']?wpv-relationship-filter=[wpv-post-id]">Child posts</a>

So we pass the ID of the parent post to the page that has our child posts View (which has an ID of 204 in my example; you can also use the page title instead of the id when inserting the wpv-post-url shortcode if you prefer).

https://toolset.com/documentation/user-guides/passing-arguments-to-views/
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.