On that page you want to first display standard Posts that are related to that kapper.
Then you want to display Posts that are not related to that kapper, yes?
You would need two separate Views for that. The first View includes a Query Filter to show posts related to the kapper set by the URL parameter.
The second needs to be the opposite, but Views doesn't let you set up a negative filter like that.
You would need to use the API filter wpv_filter_query to modify the query arguments programmatically.
With a relationship filter like this Views first queries the related posts that could appear in the results, and then specifies those in the post__in argument of the resulting WP query.
To only show posts that are not related, you could switch that argument to become a post__not_in argument.
Here's an example of the code you could use to do that for the second View:
You would need to edit the View ID (123 in the sample above, and you can add multiple View IDs to the array if you want to apply the same to more than one View).
The topic ‘[Closed] Order posts based on relationship’ is closed to new replies.