Title: identify featured image from attachment array
Last modified: August 24, 2016

---

# identify featured image from attachment array

 *  Resolved [vivekdhar](https://wordpress.org/support/users/vivekdhar/)
 * (@vivekdhar)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/identify-featured-image-from-attachment-array/)
 * Maybe somebody has solved this. After retrieving posts, how do you tell which
   of the attached images is the featured image?
    The featured image just shows 
   up like a regular attachment, something like this:
 *     ```
       "attachments"=>
       [{"id"=>114,
         "url"=>"http://test.com/wp-content/uploads/2015/04/media-6bgImage.jpg",
         "slug"=>"media-6bgimage",
         "title"=>"media-6bgImage",
         "description"=>"",
         "caption"=>"",
         "parent"=>59,
         "mime_type"=>"image/jpeg",
         "images"=> {
           "full"=>{"url"=>"http://test.com/wp-content/uploads/2015/04/media-6bgImage.jpg", "width"=>1600, "height"=>1000},
           "thumbnail"=>{"url"=>"http://test.com/wp-content/uploads/2015/04/media-6bgImage-150x150.jpg", "width"=>150, "height"=>150},
           "medium"=>{"url"=>"http://test.com/wp-content/uploads/2015/04/media-6bgImage-300x188.jpg", "width"=>300, "height"=>188},
           "post-thumbnail"=>{"url"=>"http://test.com/wp-content/uploads/2015/04/media-6bgImage-825x510.jpg", "width"=>825, "height"=>510}
           }
         }
       ]
       ```
   
 * [https://wordpress.org/plugins/json-api/](https://wordpress.org/plugins/json-api/)

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

 *  [Chris Huff](https://wordpress.org/support/users/brochris/)
 * (@brochris)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/identify-featured-image-from-attachment-array/#post-6124553)
 * I don’t think you can tell by looking at the data from the images. I think you
   need to look at data from the posts themselves. Look for the value of the “_thumbnail_id”
   key, and if there’s a featured image attached, this should give you the ID of
   the image.
 *  Thread Starter [vivekdhar](https://wordpress.org/support/users/vivekdhar/)
 * (@vivekdhar)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/identify-featured-image-from-attachment-array/#post-6124564)
 * Oh man – I completely missed this. This *is* part of the post.
    `"thumbnail"=
   >"http://test.com/wp-content/uploads/2015/04/media-6bgImage-825x510.jpg"`
 * Thanks, Chris!
 *  Thread Starter [vivekdhar](https://wordpress.org/support/users/vivekdhar/)
 * (@vivekdhar)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/identify-featured-image-from-attachment-array/#post-6124617)
 * Should have closed this.
 *  [rafaelbuiu](https://wordpress.org/support/users/rafaelbuiu/)
 * (@rafaelbuiu)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/identify-featured-image-from-attachment-array/#post-6124767)
 * I don’t get why my thumbnail variable is coming blank.

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

 The topic ‘identify featured image from attachment array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-api.svg)
 * [JSON API](https://wordpress.org/plugins/json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [rafaelbuiu](https://wordpress.org/support/users/rafaelbuiu/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/identify-featured-image-from-attachment-array/#post-6124767)
 * Status: resolved