Simple Way To Display Medium Images In TDO Mini Forms

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“.

tdo1

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.

media-settings

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>

4 thoughts on “Simple Way To Display Medium Images In TDO Mini Forms”

  1. I can not find the “Insert Uploaded Files as Attachments on post” and “Add thumbnail as download link to post content“ menu, where is it located?

    1. In TDOMF, go to Form Creator, then you will see your previously created form. If the Upload Files widget isn’t already dragged into your form you will need to do so. Then click the settings icon to the right side of the Upload Files widget.

  2. Hi, really smart solution.
    I tried to do it but cant get thumbnail size changed. When I change the thumbail size to 600px x 600px it appears as changed in the media settings but at the post editor is still appearing as 110×110 px, so when I upload a image using the TDOMF the thumbnail is 110×110
    ¿any suggestions?

    1. Make sure these two TDOMF setting are checked: “Insert Uploaded Files as Attachments on post” and “Add thumbnail as download link to post content“.

      This will only work on new images uploaded through TDOMF after the settings are changed. Not images previously uploaded

Comments are closed.