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.
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/