Categories (category)

cat_is_ancestor_of()

Checks if the specified category is a child of another specified category (all nesting levels are checked). Conditional tag.

category_description()

Gets the description of the category, which is specified on the category editing page in the admin panel (posts > categories).

category_exists()

Checks if the specified category exists. If it does, it returns the ID of that category.

get_cat_ID()

Gets the category ID by the given name.

get_cat_name()

Gets the name of the category by the passed ID.

get_categories()

Gets categories as an array of objects.

get_category()

Gets data of the specified category.

get_category_by_slug()

Gets category data by its alternative name (slug).

get_category_link()

Gets the correct link to the category page by the given category ID.

get_category_parents()

Gets a list of parent categories of the current category. The list is displayed in hierarchical order.

get_the_category_by_ID()

Gets the category name by the given ID.

in_category()

Checks whether the current (or specified) post belongs to the specified category (multiple categories can be specified). Conditional tag.

single_cat_title()

Displays the title of the category or tag. Used outside the loop. Intended for archive pages.

wp_create_category()

Simplified function for adding a category, which requires the name of the new category and, if needed, the ID of the parent category.

wp_dropdown_categories()

Display or retrieve the HTML dropdown list of categories. Instead of categories you can specify the name of an custom taxonomy.

wp_insert_category()

Inserts a new category into the database. Or updates an existing category by specifying a category ID.

wp_list_categories()

Displays a list of categories as HTML links. If you click on the link, all posts from the category will be shown.