WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
exclude connected to (1 post)

  1. aaron@rossano.com.au
    Member
    Posted 7 months ago #

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

    http://wordpress.org/plugins/posts-to-posts/

Reply

You must log in to post.

About this Plugin

About this Topic

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