wppaste
WordPress

the_category( string $separator = '', string $parents = '', int|false $post_id = false )

Since
0.71
Source
wp-includes/category-template.php:276
Displays category list for a post in either HTML list or custom format.

Parameters

$separatorstringoptional
Separator between the categories. By default, the links are placed in an unordered list. An empty string will result in the default behavior.Default: ''
$parentsstringoptional
How to display the parents. Accepts 'multiple', 'single', or empty. Default empty string.Default: ''
$post_idint|falseoptional
ID of the post to retrieve categories for. Defaults to the current post.Default: false

Uses · 1

Used by · 1

Source

function the_category( $separator = '', $parents = '', $post_id = false ) {	echo get_the_category_list( $separator, $parents, $post_id );}

History

Introduced in 0.71. One change between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.9.7
Parameter $post_id retyped from int to int|false.verified against source
0.71
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/category-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.