Function: the_category

the_category( string $separator, string $parents, integer $post_id )

Display category list for a post in either HTML list or custom format.

Shortcut: tc

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

Parameters

Name Type(s) Default Value Description
$separator string ''

Optional. Separator between the categories. By default, the links are placed in an unordered list. An empty string will result in the default behavior.

$parents string ''

Optional. How to display the parents.

$post_id integer false

Optional. Post ID to retrieve categories.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.