[wordpress插件] CPT-onomies: Using Custom Post Types as TaxonomiesCPT-onomies:使用自定义帖子类型作为分类法

wordpress 插件 文章 2020-04-04 09:20 467 0 全屏看文

AI助手支持GPT4.0

评分
94
描述

CPT-onomies is a multisite compatible WordPress plugin that allows you to create very powerful taxonomies and, therefore, very powerful relationships between your posts.

CPT-onomies 是一个与多站点兼容的WordPress插件,可让您创建非常强大的分类法,因此可以在帖子之间建立非常强大的关系。

CPT-onomies are Custom-Post-Type-powered taxonomies that function just like regular WordPress taxonomies, even allowing you to use core WordPress taxonomy functions, such as get_terms() and wp_get_object_terms().

“ rel =” nofollow“> wp_get_object_terms()。

Check out the CPT-onomy documentation to

查看CPT-onomy文档

see which core WordPress taxonomy functions work and when you'll need to access the plugin's CPT-onomy functions.

查看哪些核心WordPress分类标准功能起作用,以及何时需要访问该插件的CPT-onomy功能。

CPT-onomies includes a custom post type manager, allowing you to create custom post types and register CPT-onomies without touching one line of code!

CPT-onomies包含一个自定义帖子类型管理器,使您可以创建自定义帖子类型并注册CPT-onomies。无需触摸一行代码!

If you’re running a WordPress multisite network, you can register your custom post types/CPT-onomies across your entire network OR on a site-by-site selection.

如果您正在运行WordPress多站点网络,则可以在整个网络中或在逐站点选择中注册自定义帖子类型/ CPT本体。

All from one screen!

全部来自一个屏幕!

If you're already using a plugin, or theme, that creates custom post types, don't worry, CPT-onomies is all-inclusive. Any registered custom post type can

如果您已经在使用可创建自定义帖子类型的插件或主题,请放心,CPT-onomies包罗万象。 任何注册的自定义帖子类型都可以

be used as a CPT-onomy.

用作CPT标语。

What Is A CPT-onomy?

什么是CPT音标?

A CPT-onomy is a Custom-Post-Type-powered taxonomy that functions just like a regular WordPress taxonomy, using your post titles as your taxonomy terms.

CPT-onomy是一种由Custom-Post-Type支持的分类法,其功能类似于常规的WordPress分类法,使用您的帖子标题作为分类法术语。

“Attach”, or register, your CPT-onomy to any post type and create relationships between your posts, just as you would create taxonomy relationships.

就像创建分类法关系一样,“将” CPT术语“附加”或注册到任何帖子类型,并在帖子之间创建关系。

Need to associate a CPT-onomy term with its post?

是否需要将CPT-onomy术语与其职位相关联?

No problem!

没问题!

The CPT-onomy term’s term ID is the same as the post ID.

CPT-onomy术语的术语ID与帖子ID相同。

Is CPT-onomy An Official WordPress Term?

CPT-onomy是WordPress的正式术语吗?

No.

否。

It’s just a fun word we made up.

这只是我们创造的一个有趣的词。

Need Custom Post Types But Not (Necessarily) CPT-onomies?

是否需要自定义帖子类型,但(不需要)CPT词组?

CPT-onomies offers an extensive, and multisite compatible, custom post type manager, allowing you to create and completely customize your custom post types within the admin.

CPT-onomies提供了广泛的,且与多站点兼容的自定义帖子类型管理器,可让您在管理员中创建并完全自定义自定义帖子类型。

Why CPT-onomies?

为什么要进行CPT编程?

It doesn’t take long to figure out that custom post types can be a pretty powerful tool for creating and managing numerous types of content.

很快就可以确定,自定义帖子类型可以成为创建和管理多种内容类型的强大工具。

For example, you might use the custom post types “Movies” and “Actors” to build a movie database but what if you wanted to group your “movies” by its “actors”?

例如,您可以使用自定义帖子类型“电影”和“演员”来建立电影数据库,但是如果要按“演员”对“电影”进行分组怎么办?

You could create a custom “actors” taxonomy but then you would have to manage your list of actors in two places: your “actors” custom post type and your “actors” taxonomy.

您可以创建自定义的“演员”分类法,但随后必须在两个位置管理演员列表:“演员”自定义帖子类型和“演员”分类法。

This can be a pretty big hassle, especially if you have an extensive custom post type.

这可能是一个很大的麻烦,特别是如果您有广泛的自定义帖子类型。

This is where CPT-onomies steps in. Register your custom post type, 'Actors', as a CPT-onomy and CPT-onomies will build your 'actors' taxonomy for you, using your

这是CPT-onomies介入的地方。。将您的自定义帖子类型“演员”注册为CPT-onomy,然后CPT-onomies将使用您的“演员”分类法

actors' post titles as the terms.

演员职位的标题。

Pretty cool, huh?

太酷了吧?

Using CPT-onomies

使用CPT词组

What's really great about CPT-onomies is that they function just like any other taxonomy, allowing you to use WordPress taxonomy functions, like

CPT-onomies的真正优点在于它们的功能与其他任何分类法一样,允许您使用WordPress分类法功能,例如

"get_terms()" rel="nofollow">get_terms(),

“ get_terms()” rel =“ nofollow”> get_terms()

>get_the_terms() and wp_get_object_terms(), to

> get_the_terms()和 wp_get_object_terms()

access the CPT-onomy information you need.

访问您所需的CPT-onomy信息。

CPT-onomies will also work with tax queries when using The Loop

使用 The Loop时,CPT-onomies也可用于税收查询

, help you build custom CPT-onomy archive pages, allow you to programmatically register your CPT

“>自定义CPT-onomy存档页面,允许您以编程方式注册CPT

-onomies, and includes a tag cloud widget for your sidebar.

-onomies ,并且包含用于边栏的标签云小部件。

Check out the CPT-onomies documentation for more information

查看CPT-onomies文档以获取更多信息

.

If you’re not sure what a taxonomy is, how to use one, or if it’s right for your needs, be sure to do some research.

如果您不确定分类法是什么,如何使用它,或者它是否适合您的需求,请务必进行一些研究。

The WordPress Codex page for taxonomies is a great place to start!

分类法的WordPress Codex页面是一个很好的起点!

Note: Unfortunately, not every taxonomy function can be used at this time.

注意:不幸的是,目前不能使用所有分类法功能。

Check out the CPT-onomy documentation to see which WordPress

查看CPT-onomy文档以查看哪个WordPress

taxonomy functions work and when you'll need to access the plugin's CPT-onomy functions.

分类功能起作用,并且在您需要访问插件的CPT-onomy功能时。

安装步骤

    1. Upload ‘cpt-onomies’ to the ‘/wp-content/plugins/’ directory
    2. 将“ cpt-onomies”上传到“ / wp-content / plugins /”目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Go to Settings > CPT-onomies
    6. 转到设置> CPT-onomies

    7. Create a new custom post type or edit an existing custom post type
    8. 创建新的自定义帖子类型或编辑现有的自定义帖子类型

    9. Register your custom post type as a CPT-onomy by “attaching” it to a post type, under “Register this Custom Post Type as a CPT-onomy” on the edit screen
    10. 在编辑屏幕上的“将自定义帖子类型注册为CPT-onomy”下,通过将其“附加”到帖子类型来将您的自定义帖子类型注册为CPT-onomy

    11. Use your CPT-onomy just like any other taxonomy (refer to the CPT-onomy documentation for help)
    12. “> CPT-onomy文档以获取帮助)

下载地址
https://downloads.wordpress.org/plugin/cpt-onomies.zip
-EOF-

AI助手支持GPT4.0