Custom Fields
Re-Envisioned
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

#13295

Anh Tran
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;