Is it possible to get the thumbnail of a "relationship" post?

Support MB Relationships Is it possible to get the thumbnail of a "relationship" post?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13271
    Vee JayVee Jay
    Participant

    I'm trying to create relationship between posts.

    So far it works well, but was wondering if it would be possible to grab the thumbnail of a "relationship" post?

    How would I achieve this?

    Here's the code I got working so far when it comes to my relationship:

    $connected_pub2peeps = new WP_Query( array(
                        'relationship' => array(
                            'id'   => 'pub2peeps',
                            'from' => get_the_ID(), // You can pass object ID or full object
                        ),
                        'nopaging'     => true,
                    ) );
                    if($connected_pub2peeps)
                        echo 'Connected People: ';
                    while ( $connected_pub2peeps->have_posts() ) : $connected_pub2peeps->the_post();
                        ?>
                        <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
                        <?php
                    endwhile;
                    wp_reset_postdata();

    Nevermind just realized how dumb I was.

    #13290
    Anh TranAnh Tran
    Keymaster

    Hi Vee Jay,

    After you call $connected_pub2peeps->the_post(), you can output the featured image using the_post_thumbnail() function.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.