Skip Navigation

[Resolved] Displaying Brother Posts not working for me – 2

This support ticket is created 6 years, 4 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#917067

Hi,

Following on from this support ticket:
https://toolset.com/forums/topic/displaying-brother-posts-not-working-for-me/

I had the issue solved by using this shortcode, in the layout of the chapters CPT:

[wpv-view name="chapters-sibling-posts" wpvprchildof="[wpv-post-id id='$book']"]

However, this suddenly stopped and is not giving "no posts found".

Also, I used this shortcode to show a link back to the parent book post. however, now it is linking to the chapter post itself:

[wpv-post-link id='$book']

here is the parent book post:
hidden link

here is a chapter of the book, as a chapter CPT:
hidden link

the 2 links in blue, at the top of the chapter have this code:

[wpv-post-link id='$book']

but they are now referring to the same chapter itself, not the parent book.

also, if you scrolled down, instead of seeing the chapters, you get "no posts found".

I haven't changed anything since last update.

can you please help

thanks in advance.

#917308

Hello,

In the new post type relationship of Types plugin 3.0+, you can get the parent book post ID with:
[wpv-post-id item="@book-chapter-one-to-many.parent"]

And I have done below modification in your website:
Edit the layout "Chapters Layout", replace the codes in you mentioned above from:

[wpv-view name="chapters-sibling-posts" wpvprchildof="[wpv-post-id id='$book']"]

To:

[wpv-view name="chapters-sibling-posts" wpvprchildof="[wpv-post-id item="@book-chapter-one-to-many.parent"]"]

Please test again, check if it is fixed or not.

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