![](https://i-blog.csdnimg.cn/blog_migrate/5e7109e6ff58a38483e6c42e5b4f8e11.png)
wordpress远程附件
Do you want to allow users to add attachments in WordPress comments? By default, WordPress comments are limited to text however you can allow users to upload attachments like images and gifs to make comments more fun. In this article, we will show you how to allow users to add attachments in WordPress comments.
是否要允许用户在WordPress注释中添加附件? 默认情况下,WordPress注释仅限于文本,但是您可以允许用户上传图像和gif之类的附件,以使注释更有趣。 在本文中,我们将向您展示如何允许用户在WordPress注释中添加附件。
![Comment Attachments for WordPress Comment Attachments for WordPress](https://i-blog.csdnimg.cn/blog_migrate/17833c8ca6ce2c51ee048202098bebb3.png)
First you need to install and activate the Comment Attachment plugin. For more details, see our step by step guide on how to install a WordPress plugin.
首先,您需要安装并激活Comment Attachment插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。
Upon activation, you need to visit Settings » Discussion page and scroll down to ‘Comment Attachment’ section to configure the plugin settings.
激活后,您需要访问设置»讨论页面,然后向下滚动到“注释附件”部分以配置插件设置。
![Settings page for comment attachments Settings page for comment attachments](https://i-blog.csdnimg.cn/blog_migrate/42c9d3888edb9e4db05988d42d8f7911.png)
Comment Attachment plugin allows you to choose file types, maximum file size, and how to display those attachments on your website.
注释附件插件使您可以选择文件类型, 最大文件大小以及如何在网站上显示这些附件。
You can also choose where to show the attachment upload form (before or after default comment form fields).
您还可以选择在何处显示附件上传表单(在默认评论表单字段之前或之后)。
If attachment is an image, then you can select image size to display, and whether you want it to be linked to the original file.
如果附件是图像,则可以选择要显示的图像大小,以及是否要将其链接到原始文件。
Allowed File Types:
允许的文件类型:
The plugin allows you to select which file types you want to allow. By default, it allows users to upload images in jpeg, gif, and png formats.
该插件允许您选择要允许的文件类型。 默认情况下,它允许用户上传jpeg,gif和png格式的图像。
![allowedfiletypes Allowed file types](https://i-blog.csdnimg.cn/blog_migrate/5d1f947f75b490acd9a3a2e63ce11f19.png)
You can also enable support for PDF, Doc files, spreadsheets, presentations, audio, and video file types.
您还可以启用对PDF,Doc文件,电子表格,演示文稿,音频和视频文件类型的支持。
However we recommend keeping it to images only because audio / video can be very resource intensive for your WordPress hosting.
但是,我们建议仅将其保留在图像上,因为音频/视频对于WordPress托管可能会占用大量资源。
Don’t forget to click on the save changes button to store your settings.
不要忘记单击“保存更改”按钮来存储您的设置。
You can now visit your website and see the ‘upload attachment’ field in WordPress comment form. Try uploading files to see how they appear in the comments.
现在,您可以访问您的网站,并在WordPress注释表单中看到“上传附件”字段。 尝试上传文件以查看它们在注释中的显示方式。
![Comment form with attachment upload field Comment form with attachment upload field](https://i-blog.csdnimg.cn/blog_migrate/3a65ca21b78b101c8537543c2d6a30b9.png)
If you want to change the layout of your comment form, then check out our guide on how to style WordPress comment form.
如果您想更改评论表单的布局,请查看有关如何设置WordPress评论表单样式的指南。
You can see attachments uploaded by users when moderating comments in WordPress like this:
在WordPress中审核评论时,您可以看到用户上传的附件,如下所示:
![Review and delete attachments when moderating comments in WordPress Review and delete attachments when moderating comments in WordPress](https://i-blog.csdnimg.cn/blog_migrate/f4635d6817f10d7e580f0448d78f02d9.png)
If you don’t like an attachment, then you can simply click on the ‘Delete Attachment’ link below the comment.
如果您不喜欢附件,则只需单击评论下方的“删除附件”链接。
We hope this article helped you learn how to allow users to add attachments in WordPress comments. You may also want to see our list of 12 vital tips and tools to combat comment spam in WordPress.
我们希望本文能帮助您学习如何允许用户在WordPress注释中添加附件。 您可能还想查看我们的12个重要的提示和工具列表, 以打击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-allow-attachments-in-wordpress-comments/
wordpress远程附件