I am currently trying to create a 'Similar Posts' type section at the bottom of some of my posts. Would anyone be able to tell me how to add a featured image? At the minute, I'm using the details code:
<?php foreach(get_field('lyrics_appears_on') as $post_object): ?> <a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID) ?></a> <?php endforeach; ?>
But the the various post thumbnail snippets don't seem to work. I'm guessing this is because they don't pull the post ID like the snippets above. Is there any way I can add an image to the code above? I've tried this, but it's just a stab in the dark..
<?php wp_get_attachment_image( $post_object->ID, $thumbnail ); ?>
Thank you! :)