WordPress.org

Forums

Posts 2 Posts
How to call multiple connected posts (2 posts)

  1. mlovelock
    Member
    Posted 4 years ago #

    Hi,

    Firstly, really great plugin, thanks!

    I have two post types: customA and customB - it's a bothways relationship.

    I need to be able to call all the Custom As that are related to some of Custom Bs, so can I just specify several IDs in the 'connected' query var? And if so, what format do they take? e.g.

    $args = array(
    'post_type' => 'customA',
    'connected' => '123,456', // these IDs taken from a query on customB
    );
    $my_query = new WP_Query( $args );

    Thanks.

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

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    Might want to take a look at this thread:

    http://wordpress.org/support/topic/plugin-posts-2-posts-how-to-call-two-post-types-connected-in-one-query

    As a side-effect of that, yes it's possible now:

    $args = array(
    'post_type' => 'customA',
    'connected' => array( 123, 456 ),
    );
    $my_query = new WP_Query( $args );

    You'll need the development version (0.6-alpha).

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