如何为WordPress中的帖子添加多个作者(共同作者)

Do you want to show multiple authors for a post in WordPress? Many websites often have multiple authors working on the same article. For example, on news websites sometimes multiple journalists contribute to a single story. In that case you may want to give credit to all the authors who worked on the post. In this article, we will show you how to allow multiple authors to be associated with a post in WordPress.

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

How to allow multiple authors to be associated with WordPress blog posts

First thing you need to do is install and activate the Co-Authors Plus plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活Co-Authors Plus插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Next, you need to edit the post or page where you want to credit multiple authors.

接下来,您需要编辑要在其中归功于多位作者的帖子或页面

On the post edit screen, you will notice the new ‘Authors’ box just below the post editor.

在帖子编辑屏幕上,您会注意到帖子编辑器下方的新“作者”框。

By default, it will show the original author of the post. You can add additional authors by entering their name in the search box below.

默认情况下,它将显示帖子的原始作者。 您可以通过在下面的搜索框中输入他们的姓名来添加其他作者。

The plugin will start showing users as you type. You need to select the user that you want to add as an author by clicking on it.

键入时,该插件将开始向用户显示。 您需要通过单击来选择要添加为作者的用户。

The selected author name will now appear below the original author name.

现在,所选作者姓名将出现在原始作者姓名下方。

Multiple authors selected

You can continue adding more authors as needed. Once you are done, you can save or publish your post.

您可以根据需要继续添加更多作者。 完成后,您可以保存或发布您的帖子。

在您的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 how to copy paste code in 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 functions.php file. See our tutorial on how to find which theme files to edit in WordPress.

您需要使用负责显示帖子作者姓名的代码来编辑主题文件。 这可以是single.php,content.php或主题的functions.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();
}

Here is how it looked it on our demo website.

这是在我们的演示网站上的外观。

Multiple authors attributed to a WordPress post

For more examples of template tags, please visit plugin’s website.

有关模板标签的更多示例,请访问插件的网站。

将访客作者添加到您的WordPress网站 (Adding Guest Authors to Your WordPress Site)

By default, this plugin can only look up and show registered users 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 create an account for authors, or you can accept posts directly from front-end of your website. See detailed instructions in our guide on how to allow users to submit posts to your WordPress site.

有多种方法可以接受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 admin area 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网站。

Let’s see how to add guest authors in Co Authors Plus.

让我们看看如何在Co Authors Plus中添加来宾作者。

First, you need to head over to Users » Guest Authors page and click on the ‘Add New’ button at the top.

首先,您需要转到“ 用户”»“访客作者”页面,然后单击顶部的“添加新”按钮。

Adding a new guest author in WordPress

On the next screen, you need to provide author information such as name, email, website, etc. Once you are done, click on ‘Add new guest author’ button to save your changes.

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

Guest author details

That’s all you have successfully added a guest author.

这就是您成功添加来宾作者的全部。

Now you will be able to select them as author for posts on your WordPress site, just like you would select registered users.

现在,您将可以选择它们作为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 plugins to efficiently manage WordPress multi-author blogs.

我们希望本文能帮助您学习如何允许多位作者与WordPress中的帖子相关联。 您可能还希望查看我们的21个插件列表, 以有效管理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视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/allow-multiple-authors-to-be-associated-with-a-post-in-wordpress/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值