WordPress 中的同一篇文章有多个作者
我有一个朋友要求我为他和两个朋友建立一个网站来写电影评论。我很擅长使用 Wordpress,所以它是该网站的明显选择。我唯一的困难是他们每个人都计划对同一部电影写一篇评论,我想不出如何在一篇文章中实现多个作者。
我已经检查了一些插件,例如 Co-Author Plus,它允许多个作者署名同一篇文章,但它不提供将每个作者的内容分开的功能。
我能想到的唯一解决方案是使用自定义字段,但我更希望作者可以使用主要内容编辑器进行评论。非常感谢任何帮助!
I have a friend who has asked me to build a site for him and two friends to write movie reviews. I'm pretty good with Wordpress, so it was the obvious choice for the site. The only difficulty I have is that they each plan to write a review on the same movie, and I can't think of how to achieve multiple authors in one post.
I've checked out a few plugins such as Co-Author Plus which allows multiple authors credited to the same post, but it doesn't provide the functionality for keeping each author's content separate.
The only solution I can think of is to use custom fields, but I would prefer if the authors can use the main content editor for their reviews. Any help is greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就像我说的,最好有 1 条评论 = 1 篇帖子。
因此,我认为实现这一目标的最佳方法应该是创建帖子类型:
,并修改帖子模板以在同一页面上显示电影和相关评论。
另一种解决方案应该是使用分类法来处理电影并将帖子附加到它们上。
Like I said, it should be better to have 1 review = 1 post.
So, I think the best way to achieve this should be to create post types :
And modify post template to display movie and associated reviews on the same page.
An alternate solution should be to use taxonomy to handle movies and attach post to them.
我在试图弄清楚如何做到这一点时也遇到了同样的问题,我听从了 soju 的建议并想出了一个解决方案。可能有更好的解决方案,但这就是我的做法。我和我的朋友正在写一个动漫评论博客,我和他都会对同一部动漫写评论。
我首先创建了两种帖子类型:
。然后我创建了动漫标题的分类法,因此当用户需要对尚未添加为评论的动漫撰写评论时,他们可以将标题添加到分类法中。
我将分类法与 post_types 和 wala 相关联!这几乎就是您所需要的。
因此,现在当您想为新动漫撰写新评论时,您首先添加动漫帖子类型并写下动漫的内容并包括图片等。将标题添加到分类法并检查它。之后,您可以创建一篇帖子类型评论的新帖子并撰写评论,请记住在分类中检查正确的标题以了解这将是哪部动漫,然后您就可以开始了!
问题 1:如何将其包含到我的循环中?
好吧,您不想在循环中包含两种帖子类型,您只想在循环中包含帖子和其他帖子类型动漫,因此您在functions.php 文件中执行以下操作:
问题 2:如何显示评论?
我通过创建另一个 single.php 文件并将其重命名为 single-post_type_name.php 解决了这个问题。因此,在本例中,我为我的帖子类型动漫创建了一个 single-anime.php 文件。然后,我想获取该特定动漫的所有评论,因此我在主要内容区域的文件中添加了以下内容:
您可以通过添加更多分类法等做更多事情。我实际上已经实现了一集只需添加分类法并添加要在帖子部分中查找的标准即可进行审查。希望这会对您有所帮助,但可能有点晚了:( 感谢 soju 推荐自定义帖子类型!
I ran into the same problem with trying to figure out how to do this as well and I followed soju's advice and came up with a solution. There might be a better solution to this, but this is how I went about it. Me and my friend are doing an anime review blog and both me and him will be writing a review on the same anime.
I first created two post types:
Then I created a taxonomy for anime titles so when a user needs to write a review on an anime that hasn't been added as a review yet they can add the title into the taxonomy.
I associated the taxonomy to both post_types and wala! That's pretty much all you need.
So now when you want to write a new review for a new anime you add a anime post type first and write down what the anime is about and include pictures etc. Add the title to the taxonomy and check it. After that you then create a new post of the post type reviews and write your review, remember to check the correct title in your taxonomy for what anime this is going to, then you are ready to go!
Problem 1: How do I include this into my loop?
Well you don't want to include both post types in your loop you just want to include posts and the other post type anime in your loop so you do the following in your functions.php file:
Problem 2: How do I display the reviews?
I solved this by creating another single.php file and renamed it to single-post_type_name.php. So in this case i created a single-anime.php file for my post type anime. Then in place of the contents i want to get all the reviews for this specific anime so I added the following within the file in the main content area:
You can do a lot more with this adding more taxonomies etc. I have actually implemented an episode review by just adding a taxonomy and adding a criteria to look for in the post section. Hopefully this will help you out, might be a bit late though :( Thanks soju for recommending the custom post types!