Reply To: Trying to display all the possible connection to a post
Support › MB Relationships › Trying to display all the possible connection to a post › Reply To: Trying to display all the possible connection to a post
February 13, 2019 at 1:50 PM
#13295
Keymaster
Hi Vee Jay,
In MB_Relationships_API::each_connected
, you set property
different for each connection. So to get them all, use this code:
while ( $my_query->have_posts() ) : $my_query->the_post();
// Display connected pages
foreach ( $post->connected_confs as $post ) : setup_postdata( $post );
the_title();
endforeach;
wp_reset_postdata();
foreach ( $post->connected_posts as $post ) : setup_postdata( $post );
the_title();
endforeach;
wp_reset_postdata();
foreach ( $post->connected_press_items as $post ) : setup_postdata( $post );
the_title();
endforeach;
wp_reset_postdata();
endwhile;