Skip Navigation

[Resolved] Showing Other Child Posts on a Child Post Page

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

Problem:
Showing Other Child Posts on a Child Post Page using view OR
Display all other Teacher Posts (child) of the same Teacher (parent) which the current child Teacher Posts belongs to

Solution:
You should filter your view by post relationship with shortcode attribute and pass your parent Id as value to shortcode attribute to display the related child post.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/showing-other-child-posts-on-a-child-post-page/#post-1078492

Relevant Documentation:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/

This support ticket is created 6 years, 3 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Timothy 6 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1078298

Hi,

I have a parent CPT of Teachers and child CPT called Teacher Posts. On the child Teacher Posts I’m trying to output the other Posts(Other Teacher Posts) by that teacher but can’t get this working.

hidden link

I’ve create a View to output Teacher Posts with a Post Parent Filter set to “Post with ID set by the shortcode attribute wpvchildof”

And tried various shortcodes but none seem to work, even with a specific ID it just outputs all the Teacher Posts:

[wpv-view name="teacher-posts-on-a-teacher-post-page" order="asc" author='[wpv-post-id item="$teacher"]']
[wpv-view name="teacher-posts-on-a-teacher-post-page" wpvchildof="[wpv-post-id parent='$teacher']" ]
[wpv-view name="teacher-posts-on-a-teacher-post-page" wpvchildof="18568" ]
[wpv-view name="teacher-posts-on-a-teacher-post-page" author="Test-Vietnam-Teacher-2"]

Thanks,

Tim

#1078460

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - as I understand, you want to display all other Teacher Posts (child) of the same Teacher (parent) which the current child Teacher Posts belongs to?

if yes - I need to check your view settings - could you please share problem URL and access details so I can review your current relationship structure as well as a text example what should be your expected output.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1078492

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - could you please check now:
=> hidden link
=> hidden link

I've added the view as given under at bottom of page and I can see that its working as per your expectation.:

Minesh Test:
[wpv-view name="teacher-posts-on-a-teacher-post-page" wpvrelatedto="[wpv-post-id item='@teacher_teacher-post.parent']"]

Here is how you pass the parent:

wpvrelatedto="[wpv-post-id item='@teacher_teacher-post.parent']"

More info:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/

#1078802

I see, perfect. Thank you.

Tim