Archived topic
Showing reports with pdf thumbnail?
3 replies · Started by Matt on March 9, 2021
Hi wonderful support people, I'm looking for a bit of a steer on how to achieve the following and wondering if you can help.
I have a large number of pdf reports, to display on my website, I'm aware that wordpress automatically generates thumbnails of the front page and would like to show these linked to the pdf itself. It seems a very common use-case but can't find any plugin to do this (which is still supported), does this indicate there's a simple way to do it I'm missing?
To make something usable by editors, I was thinking of a custom post type, which I can then show using wp-show-posts - does that sound a reasonable way forward? I'm not clear how automate usage of the generated thumbnail.
I'm using a GP child theme, with GB pro and wp-show-posts. Any advice very gratefully received.
Many thanks
Hi,
I have a large number of pdf reports, to display on my website, I’m aware that wordpress automatically generates thumbnails of the front page and would like to show these linked to the pdf itself. It seems a very common use-case but can’t find any plugin to do this (which is still supported), does this indicate there’s a simple way to do it I’m missing?
To make something usable by editors, I was thinking of a custom post type, which I can then show using wp-show-posts – does that sound a reasonable way forward? I’m not clear how automate usage of the generated thumbnail.
Yeah that sounds sensible.
Consider this:
Create a custom post type "reports" which you can display as list with WP Show Posts.
As for the content of the custom post type "reports", you can embed your PDF reports to the content area by using a plugin so, in a sense, they're linked directly to an opened PDF file within the post's content.
But if you really must change the posts link directly to the PDF file itself (download), you'll have to filter the post image link with WP Show Post's filter for it. ( wpsp_image_href filter )
Wow, thanks for the rapid reply Elvin! I had looked at the embedded pdf options but dismissed it as:
- browser support seems patchy (especially on mobile)
- content isn't readable at thumbnail size
- list of pdfs creates a huge load size, the user hasn't requested
Wordpress's automated thumbnail creation, seems an ideal solution without requiring any additional plugins, but I can't see a way programmatically to interact with it?
browser support seems patchy (especially on mobile)
If you must really turn the post list thumbnails to download links, the previous filter I've mentioned is the way to go.
content isn’t readable at thumbnail size
I suggest you don't bother trying to make it readable. There's no way you can make this readable for all visitors of the site as devices users will use varies.
list of pdfs creates a huge load size, the user hasn’t requested
Ah I wasn't clear. We're listing the posts that contains the PDFs not the PDf files themselves. The PDF will only be presented once they go to the post page that presents PDF much like how it is with download pages.
Wordpress’s automated thumbnail creation, seems an ideal solution without requiring any additional plugins, but I can’t see a way programmatically to interact with it?
If you must edit the thumbnail size generated, you should be able to do that on Dashboard > Settings > Media and change the Thumbnail from 150x150 to your preference.