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: - Introduced in WordPress: 0.71
- Deprecated in WordPress: —
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().