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.
- The topic ‘Display Multiple Connections Intermingled’ is closed to new replies.