How to display the User Avatar, relationship CPT and User

Support MB Relationships How to display the User Avatar, relationship CPT and User

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40876
    JoeJoe
    Participant

    Hi,

    I am using the following code to display the title and thumbnail for relationships between 2 CPTs 'event' and 'music' :

    function test_ref() {
       $connected = new WP_Query( [
        'relationship' 	=> [
            'id'   		=> 'event-music',
            'to' 		=> get_the_ID(),],
            'nopaging'		=> true,
    ] );
    while ( $connected->have_posts() ) : $connected->the_post();
        the_post_thumbnail( array(80,80) );
        the_title();
    endwhile;
    		wp_reset_postdata();
    };

    I have setup a relationship from User to Post, the ID is event-band, it is not reciprocal. I want to display the name and profile/avatar of the user(band). How do I have to change the above code

    #40886
    JoeJoe
    Participant

    Please delete this, I made a little logical error here

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to display the User Avatar, relationship CPT and User’ is closed to new replies.