get_the_category


get_the_category ( $id = false )

Parameters:
  • (int) $id Optional, default to current post ID. The post ID.
Returns:
  • (WP_Term[]) Array of WP_Term objects, one for each category assigned to the post.
Defined at:

Description

Retrieve post categories.

This tag may be used outside The Loop by passing a post id as the parameter.

Note: This function only returns results from the default "category" taxonomy. For custom taxonomies use get_the_terms().

Related Functions

get_the_category_rss, get_category, get_the_category_list, the_category, get_the_category_by_id

Top Google Results

User discussions

wpseek mobile