[Resolved] Custom post type relationship doesn’t show the right connected posts
This thread is resolved. Here is a description of the problem and solution.
Problem:
Custom post type relationship doesn't show the right connected posts
Solution:
The problem with Views which show all of the posts of the related type rather than just the posts which are actually connected to the current post is because you are missing a Query Filter that specifies that only posts connected to the current post should be returned by the View query.
Go back to highlight the View block and in the Content Selection add a relationship Query Filter.
This support ticket is created 2 years, 9 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Tell us what you are trying to do?
I'm trying to show specific posts connected to a specific post type. But ALL posts are shown and not just the ones connected (in relation)?
Is there any documentation that you are following?
Tried a lot
Is there a similar example that we can see?
Please give me a private answer form and I will send you a video with description of the problem and give you access to the site.
I'm sorry, for some reason your first reply was lost, the ticket only now shows up again in the queue.
I watched your video.
I believe the problem with your Views which show all of the posts of the related type rather than just the posts which are actually connected to the current post is because you are missing a Query Filter that specifies that only posts connected to the current post should be returned by the View query.
Go back to highlight the View block and in the Content Selection add a relationship Query Filter.
Hello. Thank you for contacting the Toolset support.
We are sorry but I'm not sure where this ticket could be lost.
I checked on your install and to display the related post, you will have to add the "Query Filter" to filter post by relationship.
To the content tempalte "Template for Dagar" where you added both your view.
=> hidden link
Under the view's Content Selection section you can add the "Query Filter" as you can see with the following screenshot:
=> hidden link
I've added the query filter for post-relationship for your both of the views:
Filter by post relationship or repeatable fields group owner
Select posts in a Ankommande fartyg relationship that are related to the Post where this View is shown.
I can see the following post do not display any result:
- hidden link
I can see the following post does display the result:
- hidden link
Both of your forms was missing the relationship field:
- hidden link
- hidden link
I've added the relationship field to both the form just before the submit button and now when you create the post it will be automatically linked to the current post.
Ni Minesh,
Thank you for that prompt support.
When I try to add a post, I still don't see it getting added as connected?
You can try to add relationship posts here: hidden link
Please feel free to add whatever you like, the system is not online in a sharp environment.