Title: [Plugin: Advanced Custom Fields] Post thumbnail output with Post Object
Last modified: August 20, 2016

---

# [Plugin: Advanced Custom Fields] Post thumbnail output with Post Object

 *  Resolved [gasurgaelach](https://wordpress.org/support/users/gasurgaelach/)
 * (@gasurgaelach)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-post-thumbnail-output-with-post-object/)
 * 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! 🙂
 * [http://wordpress.org/extend/plugins/advanced-custom-fields/](http://wordpress.org/extend/plugins/advanced-custom-fields/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [gasurgaelach](https://wordpress.org/support/users/gasurgaelach/)
 * (@gasurgaelach)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-post-thumbnail-output-with-post-object/#post-2858374)
 * Hi all, I didn’t know of a cool wee WordPress function ( wp_get_attachment_thumb_url),
   sorry for the post!
 * Here’s what I’m using:
 * `<img src="<?php echo wp_get_attachment_thumb_url(get_post_thumbnail_id($post_object-
   >ID)); ?>" alt="<?php echo get_the_title($post_object->ID) ?>" />`

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Advanced Custom Fields] Post thumbnail output with Post Object’
is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

## Tags

 * [$post object](https://wordpress.org/support/topic-tag/post-object/)

 * 1 reply
 * 1 participant
 * Last reply from: [gasurgaelach](https://wordpress.org/support/users/gasurgaelach/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-advanced-custom-fields-post-thumbnail-output-with-post-object/#post-2858374)
 * Status: resolved