Title: [Plugin: WP Document Revisions] Adding post thumbnail support
Last modified: August 20, 2016

---

# [Plugin: WP Document Revisions] Adding post thumbnail support

 *  Resolved [bigspring](https://wordpress.org/support/users/bigspring/)
 * (@bigspring)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/)
 * Hi Ben,
 * We’ve been using this plugin a bit recently and it’s providing some excellent
   functionality. Many thanks!
 * I have a query / bug report. Adding post thumbnail support is causing some issues,
   as when you set the post thumbnail for a document, the thumbnail is treated as
   a new version of the document you’re adding it to.
 * Seems like someone else (Iain Porter) reported it hereL [http://ben.balter.com/2011/08/29/wp-document-revisions-document-management-version-control-wordpress/](http://ben.balter.com/2011/08/29/wp-document-revisions-document-management-version-control-wordpress/)
 * Do you know of a workaround / fix for the issue? I can’t work it out from your
   replies on that post I’m afraid.
 * [http://wordpress.org/extend/plugins/wp-document-revisions/](http://wordpress.org/extend/plugins/wp-document-revisions/)

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

 *  Thread Starter [bigspring](https://wordpress.org/support/users/bigspring/)
 * (@bigspring)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/#post-3090553)
 * I’ve found the solution by reading through some other comments on the thread 
   posted above, so hopefully it’ll help someone else.
 * Whilst in the loop, you need to query the post for any attachments and then foreach
   through the attachments using wp_get_attachment_image to get the actual image
   itself.
 * It’s a workaround, but works well for me and I love the fact that the document
   manager automatically creates post thumbnails for uploaded images.
 *  [shortster](https://wordpress.org/support/users/shortster/)
 * (@shortster)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/#post-3090586)
 * The way you describe is for fetching the thumbnail, right?
 * However, upon uploading the thumbnail, the document still gets overwritten with
   the thumbnail as a new revision. So this is only ok when you use this plugin 
   for managing images, which is what you probably do bigspring?
 * So, when using the plugin for documents (pdf’s in my case), the question remains,
   how do we add thumbnail support without it being hijacked by the document revisions?
 *  Thread Starter [bigspring](https://wordpress.org/support/users/bigspring/)
 * (@bigspring)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/#post-3090587)
 * That’s right, I was talking about fetching the image.
 * To summarise what I found about adding the post thumbnail – you can’t add post
   thumbnail support as it will overwrite the actual download file itself.
 * However, if the file you uploaded if a valid image type (jpg / gif / png) then
   a post thumbnail is actually created without you having to specifically set one.
   You can then use the wp_get_attachment_image function to return the post thumbnail
   that’s silently created.
 *  Plugin Author [Ben Balter](https://wordpress.org/support/users/benbalter/)
 * (@benbalter)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/#post-3090636)
 * Thumbnails are not fully supported right now. This is due to a limitation on 
   how files are uploaded. Given the media upload experience, there’s no (easy) 
   way to know when a user intends to upload a thumbnail for a document, and when
   they intent to upload a new version. The workaround would most likely to be some
   sort of “add thumbnail” button, etc., which would bipass the normal logic of 
   uploading a new version.
 * If anyone would like to take a first pass at this, pull requests are always, 
   more than welcome. I created an issue on GitHub to track the new feature ( [https://github.com/benbalter/WP-Document-Revisions/issues/33](https://github.com/benbalter/WP-Document-Revisions/issues/33))
   and will close this support thread for the time being.
 *  Thread Starter [bigspring](https://wordpress.org/support/users/bigspring/)
 * (@bigspring)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/#post-3090637)
 * Thanks for letting me know.
 * Although it’s probably not intended, post thumbnail support (kind of) works if
   you’re uploading an actual image as the document, you just need to make sure 
   you use wp_get_attachment_image rather than the_post_thumbnail.
 * Obviously doesn’t work if you’re uploading a non-browser compatible image (eg.
   TIF) or other file type (doc / xls / pdf / etc).
 * Might be worth mentioning that on the documentation somewhere. It’s not ideal,
   but will probably keep most people going until one of us has time to submit a
   pull request.

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

The topic ‘[Plugin: WP Document Revisions] Adding post thumbnail support’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-document-revisions_6c6c6c.svg)
 * [WP Document Revisions](https://wordpress.org/plugins/wp-document-revisions/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-document-revisions/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-document-revisions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-document-revisions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-document-revisions/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [bigspring](https://wordpress.org/support/users/bigspring/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-document-revisions-adding-post-thumbnail-support/#post-3090637)
 * Status: resolved