Adding a Taxonomy in WordPress - Tutorial 26

We continue to develop a portfolio in the template and in this lesson I will talk about how to set up categories for your work. For custom types, categories can be done using the register_taxonomy taxonomy customization function().

Taxonomy can be displayed as categories and as tags, in our case, we will need categories under the number [1].

wordpress taxonomy variant

Let me add the code and tell you how in the previous lesson, what needs to be done.

Let's write all the arguments of the function

Many attributes are similar to data type attributes.

name – taxonomy name, usually plural.

singular_name – taxonomy name, usually alone.

menu_name – menu item name.

register_taxonomy menu_name

all_items – text to describe all categories of a given type.

wordpress all-item label

parent_item – parent category text.

wordpress parent category taxonomy

parent_item_colon – parent category text.

new_item_name – text for the new category.

add_new_item – text to add a new category.

wordpress add new button text

edit_item – category edit text.

wordpress edit category taxonomy

update_item – text to update category.

separate_items_with_commas – text describing, that elements must be separated by commas, this doesn't work for tree type taxonomy.

search_items – category search text.

wordpress search category

add_or_remove_items – text for “removing or adding an element”, with javascript disabled. Not valid for tree taxonomies.

choose_from_most_used – text “choose from frequently used”. Not used for tree taxonomies.

not_found – text appears, if there are no categories.

slug – label for link (portfolio-work).

wordpress category slug

with_front – allows you to set a prefix for the permalink, true by default;

hierarchical – true or false enable tree URLs. If necessary, we will disassemble, as long as you take it on faith.

public – whether to show this taxonomy in the admin panel.

show_ui – show the control block for this taxonomy in the admin panel.

show_admin_column – specify whether or not to add a column to records with taxonomy data.

wordpress column taxonomy

show_in_nav_menus – true will allow you to select items from this taxonomy in the navigation menu.

wordpress taxonomy in menu wordpress

show_tagcloud – show taxonomies in tag cloud widget.

In the next lessons we will learn remove work from portfolio in the form of a lattice, but we will also do this manually and without plugins.


Buy WordPress hosting
WordPress tutor
Online tutoring services. List of courses I teach
  • Basic web design course;
  • Site layout;
  • General course on CMS WordPress and continuation of the course on template development;
  • Website development in PHP.
Read more on the page WordPress tutor
*/

Nikolaenko Maxim

Director of web studies ProGrafika. I am developing, website design and promotion. Always glad to new blog readers and good clients.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Templates for WordPress
The best hosting in Ukraine
Stable hosting for Drupal