您想在 WordPress 中显示一篇文章的多个作者吗?许多网站通常有多个作者撰写同一篇文章。例如,在新闻网站上,有时多个记者会撰写一个故事。在这种情况下,您可能需要向所有参与该帖子的作者致谢。在本文中,我们将向您展示如何允许多个作者与 WordPress 中的帖子关联。
您想显示 WordPress 帖子的多个作者吗?许多网站通常有多个作者撰写同一篇文章。例如,在新闻网站上,有时有多名记者在报道一个故事。在这种情况下,您可能想感谢所有参与该帖子的作者。在本文中,我们将向您展示如何允许多个作者与 WordPress 中的帖子关联。

First thing you need to do is install and activate the 合著者加 plugin. For more details, see our step by step guide on 如何安装 WordPress 插件.
您需要做的第一件事是安装并激活合著者加插件。 有关更多详细信息,请参阅有关如何安装 WordPress 插件步指南。
Next, you need to edit the 帖子或页面 where you want to credit multiple authors.
接下来,您需要编辑要在其中归功于多位作者的帖子或页面 。
在帖子编辑屏幕上,您会注意到帖子编辑器下方有一个新的“作者”框。
在帖子编辑屏幕上,您会注意到帖子编辑器下方有一个新的“作者”框。

默认情况下,它将显示帖子的原始作者。您可以通过在下面的搜索框中输入作者姓名来添加其他作者。
默认情况下,它将显示帖子的原始作者。您可以通过在下面的搜索框中输入其他作者的姓名来添加他们。
该插件将在您键入时开始显示用户。您需要通过单击选择要添加为作者的用户。
当他们输入时,插件将开始向用户显示。您需要通过单击选择要添加为作者的用户。
所选作者姓名现在将显示在原始作者姓名下方。
所选作者的姓名现在将显示在原始作者姓名的下方。

您可以根据需要继续添加更多作者。完成后,您可以保存或发布您的帖子。
您可以根据需要继续添加更多作者。完成后,您可以保存或发布您的帖子。
在您的WordPress网站上显示多个作者 (Showing Multiple Authors On Your WordPress Site)
Unfortunately, the plugin does not automatically display multiple authors on your site. For that you’ll need to edit your theme files. If you haven’t done this before, then please see our guide on 如何在 WordPress 中复制粘贴代码.
不幸的是,该插件不会自动在您的站点上显示多个作者。 为此,您需要编辑主题文件。 如果您之前没有做过此操作,请参阅有关如何在 WordPress 中复制和粘贴代码指南。
You’ll need to edit theme files with the code responsible for showing the author name for posts. This could be single.php, content.php, or a template tag in your theme’s 函数.php file. See our tutorial on how to find 要在 WordPress 中编辑哪些主题文件.
您需要使用负责显示帖子作者姓名的代码来编辑主题文件。 这可以是single.php,content.php或主题的函数.php文件中的模板标记。 请参阅我们的教程,以了解如何在 WordPress 中查找要编辑的主题文件 。
You will be looking for the code with template tag the_author_posts_link()
and you will need to replace it with the following code snippet.
您将在寻找带有模板标签the_author_posts_link()
的代码,并且需要将其替换为以下代码段。
if ( function_exists( 'coauthors_posts_links' ) ) {
coauthors_posts_links();
} else {
the_author_posts_link();
}
这是它在我们的演示网站上的样子。
这就是我们的演示网站上的样子。

有关模板标签的更多示例,请访问插件的网站。
有关模板标签的更多示例,请访问插件的网站。
将访客作者添加到您的WordPress网站 (Adding Guest Authors to Your WordPress Site)
By default, this plugin can only look up and show 注册用户 on your website. What if you wanted to give credit to guest authors who do not have an account on your WordPress site?
默认情况下,此插件只能在您的网站上查找并显示注册用户 。 如果您想感谢在您的WordPress网站上没有帐户的来宾作者,该怎么办?
There are multiple ways to accept user submitted posts in WordPress. You can 为作者创建一个帐户, or you can accept posts directly from front-end of your website. See detailed instructions in our guide on how to 允许用户向您的 WordPress 网站提交帖子.
有多种方法可以接受WordPress中用户提交的帖子。 您可以为作者创建一个帐户 ,也可以直接从网站的前端接受帖子。 请参阅我们的指南中有关如何允许用户向您的 WordPress 网站提交帖子详细说明。
Co Authors Plus offers a simpler work around for that. It allows you to add guest authors without giving them access to the 管理区 or writing privileges on your website. Guest authors can send you their posts via email, and you can add them to your WordPress site.
合作作者增强版为此提供了更简单的解决方法。 它允许您添加来宾作者,而无需授予他们访问管理区或在您的网站上写特权的权限。 来宾作者可以通过电子邮件将您的帖子发送给您,也可以将其添加到WordPress网站。
让我们看看如何在 Co Authors Plus 中添加客座作者。
让我们看看如何在 Co Authors Plus 中添加客座作者。
First, you need to head over to 用户 » 客座作者 page and click on the ‘Add New’ button at the top.
首先,您需要转到“ 用户”»“客座作者”页面,然后单击顶部的“添加新”按钮。

在下一个屏幕上,您需要提供作者信息,例如姓名、电子邮件、网站等。完成后,单击“添加新来宾作者”按钮以保存更改。
在下一个屏幕上,您需要提供作者信息,例如姓名、电子邮件、网站等。完成后,单击“添加新来宾作者”按钮保存您的更改。

这就是您成功添加客座作者的全部内容。
这就是成功添加客座作者所需的全部内容。
现在,您将能够选择他们作为 WordPress 网站上帖子的作者,就像选择注册用户一样。
您现在可以选择他们作为 WordPress 网站上帖子的作者,就像注册用户一样。
We hope this article helped you learn how to allow multiple authors to be associated with a post in WordPress. You may also want to see our list of 21 个插件可有效管理 WordPress 多作者博客.
我们希望本文能帮助您学习如何允许多位作者与WordPress中的帖子相关联。 您可能还希望查看我们的21 个插件列表, 有效管理 WordPress 多作者博客 。
If you liked this article, then please subscribe to our YouTube 频道 for WordPress video tutorials. You can also find us on 推特 and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube 频道 WordPress视频教程。 您也可以在推特和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/plugins/allow-multiple-authors-to-be-linked-with-a-post-in-wordpress/