- This topic has 1 reply, 2 voices, and was last updated 10 months ago by .
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.
- You must be logged in to reply to this topic.