WordPress at a glance

the_category() WP 1.0

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

Works based on: get_the_category_list()
✈ 1 time = 0.006019s = very slow | 50000 times = 16.46s = slow | PHP 7.1.2, WP 4.7.3

No Hooks.


Nothing (null).


the_category( $separator, $parents, $post_id );
Separator between the categories. By default, the links are placed in an unordered list. An empty string will result in the default behavior.
Default: ''
How to display the parents.
Default: ''
Post ID to retrieve categories.
Default: false

Code of the category: wp-includes/category-template.php VER 5.1.1

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

Related Functions

From category: For posts

More from Template Tags: Posts, Pages, ...

No comments
    Hello, !     Log In . Register