I am in the process of building a new web site and wanted a way to let visitors submit photos and videos to the site via a submission form and have that form create a draft post that I could later moderate and publish in WordPress. I found a WordPress plugin that had all the functionality I was looking for in TDO Mini Forms. This plugin allows you to customize forms for your website that will allow non-registered users and/or subscribers to submit and edit posts and pages. The submissions can be kept as drafts or published automatically.
I built a form with the plugin that lets visitors upload a file, add a title, description, tags and categories, and then verifies that they are human with reCaptcha. When submit is clicked it sends the post off to WordPress to be moderated. The only problem I had was that I could only get the post to display the thumbnail of the image submitted and not the medium or large size image that is generated by WordPress when you upload an image. After a while of poking around forums and messing with code I came up with a simple way to display the large image in the post and even have it link to a larger image displayed with Lightbox without modifying any code.
Here are the settings I used in the Upload Files Widget in TDO Mini Forms. The two important ones you need to have checked are “Insert Uploaded Files as Attachments on post” and “Add thumbnail as download link to post content“.
Since I had no need for thumbnails on the site I’m building I decided I could change the setting for the thumbnail size to be a medium size and eliminate the medium size altogether. (At first I tried to change to thumbnail size to zero and force TDO Mini Forms to use the medium image, but it inserts a height=”0″ attribute into the image tag which, in effect, displays nothing.) These settings are in your WordPress dashboard, click Settings > Media. I changed them to: Thubmail 600×600, Medium 0x0, Large 1024×1024.
So now when a post is submitted you should have an image up to 600px which is the thumbnail size and it will be linked to your large 1024px image that will open in lightbox if enabled. Your post code should look something like this:
<p><a href="http://example.com/wp-content/uploads/tdomf/299/sample-image.jpg"><img src="http://example.com/wp-content/uploads/tdomf/299/sample-image600x450.jpg" alt="sample-image.jpg" /></a></p>