Posts 2 Posts
exclude connected to (1 post)

  1. aaron@rossano.com.au
    Posted 2 years ago #

    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 );


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by aaron@rossano.com.au
  • This topic is not resolved
  • WordPress version: 3.8