• hi,
    is it possible to exclude an array of IDs from a query with a filter for a relationship?
    so for example i’ll get all the posts which are not related to these pages ids array?

    here’s an example:
    $pagesids = array(1,2,3,4);

    $args = array(
    	'post_type' => 'post',
    	'post_status' => 'publish',
    );
    
    $args['connected_type'] = array( 'post_to_page' );
    $args['connected_direction'] = 'to';
    $args['connected_to'] = $pagesids; // instead of using connected_to i would use not_connected_to
    
    $query = new WP_Query( $args );

    https://www.ads-software.com/plugins/posts-to-posts/

  • The topic ‘exclude connected to’ is closed to new replies.