Codex tools: Log in
Languages: English • Русский • 日本語 • (Add your language)
Contents |
Displays a link to the category or categories a post belongs to. This tag must be used within The Loop.
<?php the_category( $separator, $parents, $post_id ); ?>
false results in the category list of the current post.
This usage lists categories with a space as the separator.
<p>Categories: <?php the_category(' '); ?></p>
Displays links to categories, each category separated by a comma (if more than one).
<p>This post is in: <?php the_category(', '); ?></p>
Displays links to categories with an arrow (>) separating the categories. (Note: Take care when using this, since some viewers may interpret a category following a > as a subcategory of the one preceding it.)
<p>Categories: <?php the_category(' > '); ?></p>
Displays links to categories with a bullet (•) separating the categories.
<p>Post Categories: <?php the_category(' • '); ?></p>
wp-includes/category-template.php
Categories: the_category(), the_category_rss(), single_cat_title(), category_description(), wp_dropdown_categories(), wp_list_categories(), get_the_category(), get_the_category_by_ID(), get_category_by_slug(), get_the_category_list(), get_category_parents(), get_category_link(), is_category(), in_category(), the_taxonomies