I'm using 'Memeone generator' plugin for wordpress to create a meme generator website. When a user uploads a meme the plugin creates a new blog post and inserts the image into the content area and creates a title for the post. I was wondering how to take that same image and make it the featured image for that post. Below is the code they used to create the post, there might be more that goes with it but this was the main part I seen that I was editing for some other things. $new_wp_post= array( 'post_title' => $post_title, 'post_content' => '<div class="centerdiv"><img src="'. $meme->meme_url . $meme->meme_file_name.'.jpg' . '" /></div>', 'post_status' => $post_status, 'post_author' => $author Code (markup): thanks in advance, Rob
Dunno if your theme supports featured images/post thumbnails, but this article explains it pretty well: http://www.wpbeginner.com/beginners-guide/how-to-add-featured-image-or-post-thumbnails-in-wordpress/ (it also explains what codes to add)
I think you missed my point. I know how to add one manually to each post. But I have a system that creates the post and need that to create the featured image too. thanks though.
Uhm, no, I didn't miss your point. I pointed you to an article that tells you which elements to add to your array to provide the array with the information you're looking to add - in this case, the featured image. Since I haven't messed around with this function in Wordpress, I didn't post a step-by-step, but I figured you'd be able to use the information in the article to edit the code you currently have to also include the featured image.
Dude, that post tells how to do it inside the post while creating a new post and it shows how to set up your theme support. no where near what I was asking for and hardly any code on the page at all. soooo.....