WordPress contains two categories: categories and tags. Blogs and main sites are enough, but you may want to add your own. Fortunately, it is relatively simple to create WordPress custom categories to control and control data more flexibly. What is a WordPress custom taxonomy? If you are not completely sure what a taxonomy is, dataversion has the following very simple definitions: \
Therefore, simply put, taxonomy is just a way to structure, organize and identify data. WordPress essentially starts with the blog platform, so the default classification is suitable for such sites. But I soon realized that people use the platform not only on blogs, but also on other types of websites. Therefore, the platform version 3.1 introduces the custom classification function of word press. This convenient feature allows you to configure your site and configure data correctly as needed. A good example of a custom taxonomy is a news site, such as CNN or BBC, where content must be sorted by location or topic. The
Classifications can be \
How to use code to manually create WordPress categories? We know that the word \
As with categories, hierarchical classifications allow parent and child items. For example, the parent term is \
Log in to the WordPress admin panel of your site in the normal way. After entering, scroll down to move the cursor over the shape. In the drop-down box that appears, click theme editor. A warning message may appear asking you not to change the back end of the topic. In this case, you can click understand. However, if it is inconvenient to edit the website at the back end, it is better to click \
‘New town name’,’separate\u items\u with\commons’ = > \u (‘separate towns with commons’,’add\u or\remove\items’ = > \u (‘add or remove towns’,’choose\u from\most\u used’ = > \u (‘choose from the most used towns’,’menu\u name’ = > \u (‘towns’,)\/\/ Register the non hierarchical taxonomy register_taxonomy (‘towns’,’england’, array (‘hierarchical’= > false,’labels’ = > $labels,’show\u UI’= > true,’show\u in\rest’ = > true,’show\u column’= > true,’update\u count\callback’ = >’\u update\u post\u term\u count’,’query\u var’ = > query true,’rewrite’= > array (‘slug’ = >’town’,);} In both cases, you must replace the category name, label, and post type with the actual type you want to use. The
Now the picture should be as follows. In this case, you can click the update file button to save the code. Androg WordPress display custom categories now uses code to add custom categories to WordPress, but now you need to configure the display location. 1. to set the location of displaying custom categories, you must be familiar with the template hierarchy of WordPress, because you have added some code templates to the topic or sub topic of displaying custom categories. In most cases, a single in the template parts folder of the topic. PHP, content Just add code to PHP or other files. However, in theory, you can add custom classifications to all template files. The
Suppose you are not sure how to find a template used on a particular page. In this case, I recommend using the where template AMI plug-in. This displays the name of the template in use on the current page, and you can safely disable the plug-in by specifying exactly which template to use. 2. set the location where the new category of the added code is displayed in the location where the user-defined category is displayed, and then set. Navigate to the PHP file. They typically do this by navigating to the WordPress Theme Editor and selecting the appropriate file from the theme files list. You can find PHP files the same way you can find PHP files. Correct. After finding the PHP file, paste the following code: The
Male ID,’towns’,’towns:’, ‘,’ ”);? > Must be replaced with a classification name that uses a red element. This is all; Now we have added all the code needed to create and display custom categories in word press. If the new classification does not appear, make sure to add the code to the correct file. If the problem persists, you can consult the developer of a specific topic for instructions on how to customize the display to include the new classification scheme. The
In all cases, WordPress Codex is all the mobile tools related to the back end of the site, including custom classification and template hierarchy. The article will continue below. If it is inconvenient to add code to WordPress to create a user-defined taxonomy using the male plug-in, it is best to use the WordPress user-defined taxonomy plug-in. The main advantage of using WordPress classification plug-in is that it simplifies the process and is ideal for beginners, but the disadvantage is that the plug-in may slow down the site. That is, categorizing plug-ins, especially code
Because it is not used much, it is best to use one for complete convenience. The method to create a custom category using the plug-in is as follows: 1. there are several plug-ins used to add plug-in installation and activate custom classification, but the plug-in used to demonstrate the process is the custom post type UI plug-in. The popular plug-ins can be used in the word press plug-in directory. It’s completely free, very light and easy to use, so please and activate it in the normal way. Other plug-ins will get the same results. The process of adding categories should be reasonably similar no matter what is selected. 2. go to add \/ edit taxonomy. A new entry named \
Best. Even if you are good at coding, plug-ins are still a good option because you can quickly and easily create taxonomies without having to create backups every time. Haven’t you created a custom category for the WordPress site yet? Or do your tags and categories run basic blogs to meet your needs? In the comments section below, please provide tips on categories you may have.