cpt cpm_使用CPT-onomies在WordPress中使用自定义帖子类型作为分类法

cpt cpm

If you have ever used custom post types then you know how powerful they can be when it comes to organizing your content. What do you do though if you want to organize one of your post types according to another?

如果您曾经使用过自定义帖子类型,那么您就会知道它们在组织内容方面的功能。 但是,如果您想根据另一种信息来组织其中一种,该怎么办?

For example, let’s say you have two custom post types. One of them is your favorite movies, while the other is your favorite actors. One way to link these posts would be to create a taxonomy using the actor names and tag each movie with the actors that play in it. The problem with this is that now you will be managing an actors taxonomy as well as an actors custom post type. The best way to prevent this and streamline the relationships between your two pieces of content is to make the actual actors post type into a taxonomy. In this post we are going to show you how to do that.

例如,假设您有两种自定义帖子类型。 其中一个是您最喜欢的电影,而另一个是您最喜欢的演员。 链接这些帖子的一种方法是使用演员名称创建分类法,并在其中播放的演员标记每部电影。 问题在于,现在您将要管理一个演员分类法以及一个演员自定义帖子类型。 防止这种情况并简化两个内容之间的关系的最佳方法是使实际角色将类型发布为分类法。 在这篇文章中,我们将向您展示如何做到这一点。

First, download and install the CPT-onomies WordPress plugin. Once you do this if you go to Settings » CPT-onomies you will be able to create and organize all of your new custom post type taxonomies.

首先,下载并安装CPT-onomies WordPress插件 。 完成此操作后,如果转到“设置”»“ CPT术语”,则可以创建和组织所有新的自定义帖子类型分类。

CPT-onomies settings

As you can see in the screenshot above, you can control which post types are linked to one another. In this example, actors and directors are linked to movies. If you want to add or edit any of your custom post types, you can easily do this by selecting either the “add a new custom post type” button or editing your current custom post types (see screenshot below).

如您在上面的屏幕截图中所见,您可以控制哪些帖子类型彼此链接。 在此示例中,演员和导演链接到电影。 如果要添加或编辑任何自定义帖子类型,则可以通过选择“添加新的自定义帖子类型”按钮或编辑当前的自定义帖子类型来轻松实现(请参见下面的屏幕截图)。

CPT-onomies edit a custom post type

Once you are done adding and editing all of your post types you can use them just as you would any other tag or category. In our example actors and directors were linked to movies so if you go to the movies post type then you will notice that in the area normally reserved for taxonomies you can now add actors and directors to your movies.

添加和编辑所有帖子类型后,就可以像使用其他任何标签或类别一样使用它们。 在我们的示例中,演员和导演已链接到电影,因此,如果您转到电影帖子类型,则您会注意到,在通常为分类法保留的区域中,现在可以将演员和导演添加到电影中。

CPT-onomies add categories

Download CPT-onomies WordPress Plugin

下载CPT-onomies WordPress插件

翻译自: https://www.wpbeginner.com/plugins/using-custom-post-types-as-taxonomies-in-wordpress-cpt-onomies/

cpt cpm

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值