I’m also having trouble bringing this into my template file.
The thumbnail is created and is in the media library, but I cannot get it to show. I can’t see any reference anywhere to a link between the attachment file (the PDF) and the thumbnail that has been created.
I have tried the following code in my template file: I am using the Advanced Custom Fields plugin, and my custom field for the PDF is called ‘file’ hence the get_field('file');
<?php $attachment_id = get_field('file');
$filethumb = get_post_thumbnail_id( $attachment_id ); ?>
<div class="thumb"><?php the_post_thumbnail( $filethumb ); ?></div>
I have lots of other elements on the template using the $attachment_id
and it is returning the id of the PDF file (which i’m using for file names, file sizes etc)
I’m not sure how to go about testing it as you have mentioned above. My theme does not have a single-attachment.php file…
You mention that it works as the featured image, which I have a meta box for on my edit page – should the thumbnail be being displayed here?
This looks to be a super sweet plugin, worthy of many stars : )