It is possible wit some PHP codes, I have setup a demo in your website:
1) Dashboard-> Toolset-> Settings-> Custom Code,
hidden link
code "display-posts-with-relationship", add below PHP codes:
<?php
/**
* New custom code snippet.
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
function no_parent_query_func($query_args, $view_settings, $view_id){
if($view_id == 344294){
add_filter( 'posts_where', 'no_parent_posts_where_func', 10, 2 );
}
return $query_args;
}
function no_parent_posts_where_func($where){
global $wpdb;
$relationship_slug = 'agreement_semen';
$where .= ' AND ' . $wpdb->posts . '.ID NOT IN(
SELECT child_id FROM ' . $wpdb->prefix . 'toolset_associations t1
LEFT JOIN '. $wpdb->prefix . 'toolset_relationships t2 ON t2.id = t1.relationship_id
WHERE t2.slug = \'' . $relationship_slug . '\' )';
return $where;
}
function remove_no_parent_posts_where_func($query_args, $view_settings, $view_id){
if($view_id == 344294){
remove_filter( 'posts_where', 'no_parent_posts_where_func');
}
return $query_args;
}
add_filter( 'wpv_filter_query', 'no_parent_query_func', 99, 3 );
add_filter( 'wpv_filter_query_post_process', 'remove_no_parent_posts_where_func', 10, 3 );
Notice:
344294 is the view's ID of below step 2)
'agreement_semen' is the specific post type relationship slug
2) Modify the post view "Semen with Agreements",
hidden link
- enable option "Pagination enabled with manual transition and page reload"
- in section "Pagination and Sliders Settings", add some Pagination shortcode:
Total [wpv-found-count] items
<ul class="pagination">
<li class="page-item">[wpv-pager-prev-page][wpml-string context="wpv-views"]Previous[/wpml-string][/wpv-pager-prev-page]</li>
<li class="page-item">[wpv-pager-next-page][wpml-string context="wpv-views"]Next[/wpml-string][/wpv-pager-next-page]</li>
</ul>
- in section "Loop Editor", remove the [wpv-conditional] shortcode, since we have already applied the filter using PHP codes.
Test it in front-end:
hidden link
Please check if it is what you need