Title: Setting Featured Image with code&#8230;
Last modified: August 19, 2016

---

# Setting Featured Image with code…

 *  [whatadewitt](https://wordpress.org/support/users/whatadewitt/)
 * (@whatadewitt)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/setting-featured-image-with-code/)
 * Hi guys,
 * I was wondering how difficult it would be to do the following…
 * I want to set up a forum so that all of my site users can enter data into. This
   data will be used to create a post that will have a featured image… is there 
   a way to do this through code? I think I can do most of it, except I am not sure
   how I can get an image to upload properly (with all the resized versions and 
   whatnot) and set this posts’ featured image through code
 * The only page I’ve really found with any information is [http://codex.wordpress.org/Using_Image_and_File_Attachments](http://codex.wordpress.org/Using_Image_and_File_Attachments),
   but it’s not really giving me any code…
 * Thanks,
 * –d

Viewing 1 replies (of 1 total)

 *  [landwire](https://wordpress.org/support/users/landwire/)
 * (@landwire)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/setting-featured-image-with-code/#post-1757904)
 * Hi there,
    did you have any luck with this? I would like to do a similar thing,
   uploading an image with gravity froms and then setting that image as the posts
   thumbnail. Any pointers are appreciated!

Viewing 1 replies (of 1 total)

The topic ‘Setting Featured Image with code…’ is closed to new replies.

## Tags

 * [media](https://wordpress.org/support/topic-tag/media/)
 * [upload](https://wordpress.org/support/topic-tag/upload/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [landwire](https://wordpress.org/support/users/landwire/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/setting-featured-image-with-code/#post-1757904)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
