WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get the category by ID

Description

Retrieve category name based on category ID.

Usage

<?php get_the_category_by_ID$cat_ID ); ?>

Parameters

$cat_ID
(int) (required) Category ID.
Default: None

Return Values

(string) 
Category name. WP_Error if cat_ID does not exist. See is_wp_error() for more information.

Change Log

Since: 0.71

Source File

get_the_category_by_ID() is located in wp-includes/category-template.php

Related

See also index of Function Reference and index of Template Tags.