
wordpress 缩略图
Recently, one of readers users asked if it was possible to regenerate PDF thumbnails for old uploads in WordPress? In WordPress 4.7, you now have thumbnail previews for all new PDF files. However, this change does not affect older uploads. In this article, we will show you how to regenerate PDF thumbnails in WordPress for older uploads.
最近,一位读者用户问是否可以为WordPress中的旧上传内容重新生成PDF缩略图? 在WordPress 4.7中 ,您现在具有所有新PDF文件的缩略图预览。 但是,此更改不会影响较早的上传。 在本文中,我们将向您展示如何在WordPress中为较早的上载重新生成PDF缩略图。

为什么以及谁需要重新生成PDF缩略图? (Why and Who Needs to Regenerate PDF Thumbnails?)
WordPress introduced PDF thumbnail previews in WordPress 4.7. This feature creates image previews of the first page of a PDF file uploaded using media uploader.
WordPress在WordPress 4.7中引入了PDF缩略图预览。 此功能创建使用媒体上传器上传的PDF文件首页的图像预览。
However, this feature only works on new PDF files that you uploaded after updating your site to WordPress 4.7.
但是,此功能仅适用于将网站更新为WordPress 4.7后上传的新PDF文件。
All older PDF files will still appear as a generic icon in the media library, and you will still have to use a PDF plugin to show a thumbnail preview on attachment pages.
所有较旧的PDF文件仍将在媒体库中显示为通用图标,并且您仍将必须使用PDF插件在附件页面上显示缩略图预览。
If you regularly upload PDF files, then you will need to regenerate thumbnail for your older PDF uploads.
如果您定期上传PDF文件,则需要为较旧的PDF上传文件重新生成缩略图。
It is similar to regenerating thumbnails for images after adding new image sizes to your WordPress theme. However, those plugins do not support PDF files at the moment.
这类似于在WordPress主题中添加新图像大小后为图像重新生成缩略图 。 但是,这些插件目前不支持PDF文件。
Having said that, let’s take a look at how to regenerate PDF thumbnails for older uploads in WordPress.
话虽如此,让我们看一下如何为WordPress中的较早上传重新生成PDF缩略图。
在WordPress中重新生成PDF缩略图 (Regenerate PDF Thumbnails in WordPress)
Before you move on, please make sure that you are using WordPress 4.7 or higher. Also make sure that you have imagemagick extension installed on your server.
在继续之前,请确保您使用的是WordPress 4.7或更高版本。 还要确保在服务器上安装了imagemagick扩展名。
You can test imagemagick by simply uploading a PDF file to your WordPress site. If it shows a thumbnail preview for your PDF file, then you are good to go.
您只需将PDF文件上传到WordPress网站即可测试imagemagick。 如果它显示您的PDF文件的缩略图预览,那么您就很好了。
Please note, that the plugin we are going to use in this article, will regenerate thumbnails for all your older image files as well. As a precaution, backup your WordPress site or at least backup your /wp-content/uploads/
folder.
请注意,我们将在本文中使用的插件也将为所有较旧的图像文件重新生成缩略图。 作为预防措施,请备份您的WordPress网站或至少备份您的/wp-content/uploads/
文件夹。
First thing you need to do is install and activate the Force Regenerate Thumbnails plugin.
您需要做的第一件事是安装并激活“ 强制重新生成缩略图”插件。
The plugin is hosted on GitHub. If you haven’t installed plugins from GitHub before, then take a look at our guide on how to install WordPress plugins from GitHub.
该插件托管在GitHub上。 如果您以前从未从GitHub 安装WordPress插件,请查看我们的指南, 了解如何从GitHub安装WordPress插件 。
Upon activation, you need to visit Tools » Force Regenerate Thumbnails page.
激活后,您需要访问工具»强制重新生成缩略图页面。

Here you can regenerate thumbnails for all images and PDF files you uploaded using WordPress media uploader. Click on ‘Regenerate All Thumbnails’ button to continue.
在这里,您可以为使用WordPress媒体上传器上传的所有图像和PDF文件重新生成缩略图。 单击“重新生成所有缩略图”按钮以继续。
The plugin will now start processing all images on your website. It will take some time, depending on how many images and PDF files you have.
现在,该插件将开始处理您网站上的所有图像。 这将需要一些时间,具体取决于您拥有多少图像和PDF文件。
Once finished, you can visit Media » Library page and you will be able to see thumbnail previews for your old PDF uploads.
完成后,您可以访问Media»Library页面,并且可以查看旧PDF上传的缩略图预览。

The plugin also allows you to regenerate thumbnails for individual files. If you do not have many PDF files, then it would be better to regenerate thumbnails individually.
该插件还允许您重新生成单个文件的缩略图。 如果您没有很多PDF文件,则最好单独重新生成缩略图。
You will need to visit Media » Library page and switch to the list view by clicking on the list view button.
您将需要访问媒体»库页面,然后通过单击列表视图按钮切换到列表视图。
After that take your mouse over to a PDF file, and you will be able to see ‘Force regenerate thumbnails’ link.
之后,将鼠标移至PDF文件,您将可以看到“强制重新生成缩略图”链接。

Clicking on the link will regenerate thumbnails for that particular file.
单击链接将重新生成该特定文件的缩略图。
Once you have regenerated thumbnails for all your old PDF uploads, you can safely deactivate and delete the plugin. Uninstalling or deleting the plugin will not delete the thumbnails regenerated by the plugin.
重新生成所有旧的PDF上传缩略图后,就可以安全地停用和删除该插件了。 卸载或删除插件不会删除插件重新生成的缩略图。
We hope this article helped you regenerate PDF thumbnails for old uploads in WordPress. You may also want to see our list of 24 must have WordPress plugins for business websites.
我们希望本文能帮助您为WordPress中的旧上传文件重新生成PDF缩略图。 您可能还希望查看我们的24个列表, 这些列表必须具有用于商业网站的WordPress插件 。
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/plugins/how-to-regenerate-pdf-thumbnails-in-wordpress/
wordpress 缩略图