Is there a built-in feature or plugin that allows you to attach a document to a post or page such that the actual attachment file is one thing (eg a PDF) but the thumbnail images are another (eg a JPEG)? CLARIFICATION: the thumbnail does not need to be automatically generated (it could be a separate upload)

The use case here is a document library, where you have a little screenshot of what that document looks like but when you click the attachment, you can download the original document.

  • 2
    I don't know any plugins that can do this but that doesnt stop you extending WP to do this. stackoverflow.com/questions/467793/… there is a start. This will allow you to convert pdf to image in PHP
    – Scott
    Aug 26 '11 at 13:16
  • Note that I'm not necessarily suggesting that the image thumbnail should be automatically generated. Just have the ability to upload a separate JPG or PNG and associate it as the thumbnail with a larger file.
    – Tom Auger
    Aug 26 '11 at 15:46
  • 1
    I could have sworn I saw something that could associate an uploaded image with another media file, but I cannot locate it for the life of me. This looks like a promising direction, but I have no idea if it actually works or not: xplus3.net/2008/11/17/custom-thumbnails-wordpress-plugin Aug 26 '11 at 19:12
  • @helenhousandi brilliant blog post. I'ma try the plugin now, see how well it works.
    – Tom Auger
    Aug 28 '11 at 17:32
  • @helenhousandi well, the plugin appears to be broken in WP 3.2.1, but there's a lot of good code in there that might be salvageable. I'll post back if I write a plugin
    – Tom Auger
    Aug 28 '11 at 17:38

Good news for this old question, since WordPress 4.7, pdf's thumbnail are automatically generated.

  • Yes, good point! I had been following this in the core updates and then totally forgot about it. When it actually comes out, I'll update this to the real answer.
    – Tom Auger
    Nov 15 '16 at 20:42

Basic HTML?

<a href="your.pdf">
<img src="image.jpg" />

When you insert and image there is a field for the url called Link URL, you can just put your download url there.

Please at least explain the down vote, I'm pretty certain this answers the OP's question.

  • +1 for suggesting a completely out-of-the-box way to handle this. It is, in fact, an approach I have been considering in the absence of other options. The downvote was probably because your answer seems to indicate that I should hard-code the URLs with HTML, but this is not necessary, since the Insert Image or Insert Media buttons will do all that for you.
    – Tom Auger
    Aug 28 '11 at 17:25
  • 1
    Sometimes the best solution is a simple one we overlook, if this is still not what you want, for instance it might be hard for clients, I do have another solution.
    – Wyck
    Aug 28 '11 at 18:31
  • please if you have the time, post your other solution. This is not just for me, but for future seekers who come upon this thread. Appreciate you giving back to the community.
    – Tom Auger
    Aug 29 '11 at 12:23
  • Did the thumbnail or image need to be an actual screenshot or just a generic image.
    – Wyck
    Aug 29 '11 at 15:06
  • It will be a generated image in most cases. I'm totally cool with it being a separate image that is created manually (outside WP) and uploaded separately.
    – Tom Auger
    Aug 29 '11 at 20:06

WP-Filebase ended up being the free plugin solution we went with. This is actually a pretty cool plugin with a lot of power under the hood, though the interface is far from slick. When you upload any kind of document, you have the option to go to an "Advanced" upload form, which allows you to upload a separate thumbnail for the document. Then, when you decide to list the document, whether using shortcode, or automatically linking the doc to a page, you'll see the thumbnail instead. Unfortunately, no ability to generate / manipulate / scale the thumbnail unlike the native Media upload process. Still, it's a useful tool with some basic Document Management features that make it a good fit for small DMS requirements.


Try this plugin. It has features that you need: Advanced Custom Fields

Its free, But if you need repeater feature, you'll need to purchase the license key.

  • How do you figure that ACF will be able to help me with my media upload issue?
    – Tom Auger
    Aug 28 '11 at 17:22

Wordpress already have the mechanism. We solve this by adding support for post-thumbnail (featured image) for attachments, and handle the representation for each file as normally do for other post types. (if has post thumbnail: the_post_thumbnail() etc etc.) Just add to functions.php:

function entex_add_attachment_support(){
      add_post_type_support('attachment', 'thumbnail');
add_action('after_setup_theme', 'entex_add_attachment_support');

Make shure to make the template files to look for the thumbnail, or filter in by hooks. There are plenty of ways to implement this solution. It feels a little confusing at the beginning to have featured image for an image, but its really handy for many objectives. You can also filter in to "read" this in Library table etc etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.