WordPress categories, tags, categories, and terms can be confusing. There is no doubt that when you first start word press, you will use categories and tags, but if you go deeper into the system and start using it as a CMS, the custom taxonomy will start. But what is the difference between them all? How is it available on the site? The purpose of this post is to understand categories, tags, classifications, and terms and to determine their use. Let’s look at a few examples of how to use them, and how our plug-ins can use them to add additional functionality to the site. The
Categories, tags, classifications, and terms: definitions let’s start with a few definitions in order to know exactly what we’re talking about. The first one that needs to be defined is the taxonomy. Because this is the most widely used term. What is taxonomy? The taxonomy is not just for WordPress words. Oxford English Dictionary defines the following categories: \
In word press, classification is a grouping mechanism for some posts (or links or custom post types) It is more specific but does not actually fix it. It may be easier to provide a few examples to define the classification. Classification is a grouping system used to classify all types of posts in word press. For example, a category is just a category. Mark as is. You can also create custom categories to apply to posts or custom post types. To prevent confusion between custom post types and regular posts, it is very common to create custom categories in custom post types to classify posts. The
For example, when installing the support system plug-in, two custom post types will be registered: support ticket and FAQ. Two custom categories will also be registered: ticket category and FAQ category. This allows you to separate tickets and FAQs from blog posts. What is duration? A term is a grouping of taxonomies used to distinguish posts. For example, if you are using the support system plug-in and you have created categories (such as billing, sales, and support) for each support team, each category will become a term for the ticket category classification. It can be repeated, but different terms can be set for FAQ category classification. The
The support system plug-in will register two custom post types and two custom categories. However, unlike WordPress, these terms are stored separately in the database. Even with the same name. What is a category? This brings people back to the category that is often confused with classification. Categories work as follows: A category is a category. The single category added is a term in the category classification. Therefore, if you create \
So, what is a label? Tags are similar to categories. Terms in the post_tag taxonomy. Therefore, if word press and tutorial are tags of posts, they are terms in the post_tag classification system. (don’t ask why the tag is posttag, not posttag. This is one of the mysteries of WordPress.) However, you may want to know the difference between categories and tags. And why do we need both? Categories and tags differ in one important respect. Category is hierarchical, label is not. Subcategory of parent category
You can create rings, but you cannot do the same for tags. This is why categories are much more likely to organize sites than tags. The
When registering unique custom classifications (or when the plug-in automatically executes), these classifications can be hierarchical or non hierarchical, so they can work like categories or tags. Whoo! I hope everything can be understood now. Now that we have determined the classification and term creation classification and what the term is, let’s take a look at how to create these projects. WordPress has several built-in categories. These are: category label link categories – not applicable to general posts, but applicable to link post types. This is the form of hangover when blogrol is available in WordPress. Link categories can be ignored. Post format – this applies to general posts and identifies post formats such as video, text, etc. I think this is very useful for bloggers, but I haven’t used it personally or seen many examples. Used – if you know good, please add it to the comment! Therefore, WordPress provides four basic categories by default, two of which are particularly useful. Category classification has a preset term (unclassified term). However, there are no terms in the post tag category after the user directly adds them. The
But this doesn’t have to be a restriction on categories and terms on your site. WordPress allows you to register a custom category and apply it to the desired post type. You can register a new taxonomy for posts, or you can register with the new post type to apply. Or both. You can use the register_taxonomy() function to create a new taxonomy without writing code. The custompress plug-in allows you to easily register custom categories. Register the classification using one of these methods. You can also use the wp_insert_term() function to create terms programmatically. This is useful when creating plug-ins that contain classification schemes to be pre populated with terms. So, for example, if you are writing a ticket support plug-in like ours, you can create a priority classification system and populate it in advance using high, media, and low terms. (no one will use anything other than high!) The
However, the easiest way to create terms is to use the relevant screen of the WordPress administrator. The following is the screen for creating ticket categories for supporting system plug-ins. Adding a new term here is equivalent to adding a new category through the categories screen. ‹ creative use of categories, categories and terms in most cases, categories will be maintained separately from custom categories and corresponding terms. This makes sense when you use third-party plug-ins that must run on multiple sites. Developers do not know how to use categories or standard posts on the site, so the categories registered by the plug-in will interact with them. The
However, if you are creating your own plug-ins, you can use more imagination. If you use a custom category to add a breakdown site to a regular post based entirely on the post, the category may not be sufficient to classify the post. As you can see, it uses multiple levels of subcategories, and the top-level category must actually be a separate classification system. One way to confirm that this is happening is to consult whether there are interactions between different sub classification systems. You can also ask if a top-level category has been assigned to a post. The
Author and genre: I wrote a blog for all
So you really need to write two new classification systems, as subcategories of other authors and genres, and as the top category, there are writers and genres. This is for two reasons. Each book has one (or more) post, which is always available under a specified author, category and type. Do not assign a creator or top-level category of type to a post. Creating a new taxonomy also allows specific authors to encode custom queries to find all books of a specific type. You can use categories to do this, but they are untidy. There is no reason why it is not applicable to the user-defined post types and standard Posts registered without registering the user-defined classification and using the user-defined classification custom taxonomy, as well as the posts and user-defined post types. Suppose you work on a Book blog. A user-defined post type named review is created to list the comments of the books. This is different from the more common blog posts. You can register a custom category of comments so that readers can find comments for books of that type. But why don’t blog posts use this category? You can then create posts for each type of interest and use the pre_get_posts hook to list posts and comments of that type on the classified term archive page. Alternatively, you can create a custom template file (called taxonomy-gener.php) for the classification and run two loops. One for comments and one for posts. You can also add taxonomies to post types that typically do not have taxonomies registered, such as adding taxonomic pages to pages. To add a category to a post type, use the register_taxonomy_for_object_type() function. This allows you to add an existing category to an existing post type. For example, to add a category to a page, add the following to the theme feature file (or plug-in): The loading summary dd1ba89eebf571093dfd69e59cacd9fb does not use the existing taxonomy, but uses its own registered taxonomy. Just add it to the code that uses the register_taxonomy() function to register the taxonomy. The second parameter of this function is the post type to which the taxonomy is applied. If you want to use multiple post types, include them in the array. Therefore, you have registered the comment post type. To register the type classification to be applied to comments, pages and posts, please register the classification: Load summary dd1ba89eebf571093dfd69e59cacd9fb the first parameter is the taxonomy ID, the second parameter is the post type array, and the third parameter is the parameter for the defined taxonomy. You can apply classifications to pages and custom post types to create styles for comments, posts, and pages of that type. You can also further complete the task by identifying the category to which a given page belongs, and then executing a custom query on the page template that outputs the posts and comments of that category after the page content. Alternatively, you can display page content and comments and posts on the classified archive page. Days are the limit! Categories, categories, tags, and terms can be very powerful. One of the functions of registering your own category is to convert word press into a content management system, rather than a simple blog platform. Using all the methods of classifying available content, you can create a custom site that displays exactly where you need it. Don’t get involved in differences in categories and categories. Category is just an example of classification. The category added to the site is the term of category classification. With this in mind, you can easily master categories and taxonomies. Extend categories, tags, and classifications on your site
Do you have any idea what he should do? Please share your comments in the comments below. Tags: category Tags