WordPress.org

Support

Support » Plugins and Hacks » Display Multiple Connections Intermingled

Display Multiple Connections Intermingled

  • I have 3 post types, cases, research, interviews. Both research and interviews are connected to cases, but not to each other.

    On the single-case page I want to display both research and interviews that are connected to it, but they need to display together by the publish date. For instance:

    CASE: 123
    Interview Title 1/10/13
    -Interview Content
    Research Title 1/11/13
    -Research Content
    Interview Title 1/14/13
    -Interview Content
    Research Title 1/22/13
    -Research Content
    Interview…

    Is this even possible? I have no problem getting them to display separately but inline is a no go. I have tried :

    // Find connected posts
    $connected = new WP_Query( array(
      'connected_type' => array(
          'interview_to_cases',
          'research_to_cases',
      ),
      'connected_items' => get_queried_object(),
      'nopaging' => true,
      'orderby' => 'date',
      'order' => 'ASC',
    ) );

    and something like:

    $my_query = new WP_Query( array(
    	'connected_items' => get_queried_object(),
    	'nopaging' => true,
      	'orderby' => 'date',
      	'order' => 'ASC',
    ) );
    
    p2p_type( 'research_to_cases' )->each_connected( $my_query, array(), 'research' );
    
    p2p_type( 'interview_to_cases' )->each_connected( $my_query, array(), 'interview' );

    I guess what I need is to get two connected_type into a single loop so it can display them in date order as though they were a single connection.

    Again, I don’t know if this is even possible or if I am just thinking about it wrong, any help would be appreciated.

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

Viewing 1 replies (of 1 total)
  • I am having a similar issue. In my case I have authors who write articles and authors who write recipes. So authors are connected with both articles and recipes, but I’d like to create one intermingled date-sorted list of both their articles and their recipes to show on the author page.

    Just like @jsing, I have no problem producing two independent lists on the author page, but have had no luck getting those lists to intermingle.

Viewing 1 replies (of 1 total)
  • The topic ‘Display Multiple Connections Intermingled’ is closed to new replies.