Title: Featured image
Last modified: May 18, 2020

---

# Featured image

 *  Resolved [robs23](https://wordpress.org/support/users/robs23/)
 * (@robs23)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/featured-image-469/)
 * Hi,
    I have a ‘foto’ field in my block that is of type Image. This is the main
   image of the post, the one that should be kind of a thumbnail of the post. Now
   I noticed that WP has similiar field – featured image. I was wondering if I can
   set my block somehow so the image that’s selected in ‘foto’ field would automatically
   become post’s featured image? I wouldn’t like the user that is creating post 
   to select the image twice (1. ‘foto’ field, 2. Featured Image) as it’s repetitive
   action.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffeatured-image-469%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/featured-image-469/#post-12854898)
 * Hi [@robs23](https://wordpress.org/support/users/robs23/),
    Thanks for asking,
   that’s interesting.
 * Could the block template use [get_the_post_thumbnail()](https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/)
   to get the thumbnail?
 * Maybe I’m not understanding the use case.
 *  [jasujs](https://wordpress.org/support/users/jasujs/)
 * (@jasujs)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/featured-image-469/#post-12855167)
 * Hi guyz,
 * I got kind of the same interrogation.
 * I’m creating a post page, and add some photos (*the only ones in the post) via
   a blocklab block.
 * I’d like that the first img of the post become automatically the post featured
   image. (so you don’t need to set manually a featured image each time)
 * I tried this snippet wich works fine with a basic post ([gavick.com](https://www.gavick.com/blog/wordpress-automatically-set-post-featured-image))
   but I think that, as images added via blocklab are not linked (attached) to the
   post, this function don’t retrieve it.
 * I was wondering if there’s a way to get the first image appearing on a post page(
   maybe by getting the first img tag of the post) and then assign it as featured
   image of this post… Maybe this could be a solution, I don’t know.
 * Bye.
 * PS : If what I ask for is impossible, getting get_the_post_thumbnail via a blockfield
   could be, indeed, a solution
    -  This reply was modified 6 years, 2 months ago by [jasujs](https://wordpress.org/support/users/jasujs/).
    -  This reply was modified 6 years, 2 months ago by [jasujs](https://wordpress.org/support/users/jasujs/).
 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/featured-image-469/#post-12855515)
 * Hi [@jasujs](https://wordpress.org/support/users/jasujs/),
 * > I was wondering if there’s a way to get the first image appearing on a post
   > page (maybe by getting the first img tag of the post) and then assign it as
   > featured image of this post… Maybe this could be a solution, I don’t know.
 * Sorry, I can’t think of a good way to do that.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Featured image’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/block-lab_5c34e8.svg)
 * [Block Lab](https://wordpress.org/plugins/block-lab/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/block-lab/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/block-lab/)
 * [Active Topics](https://wordpress.org/support/plugin/block-lab/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-lab/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-lab/reviews/)

## Tags

 * [featured image](https://wordpress.org/support/topic-tag/featured-image/)

 * 3 replies
 * 3 participants
 * Last reply from: [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/featured-image-469/#post-12855515)
 * Status: resolved