WordPress Category Functions

About This Index
This page is the WordPress Category Functions index. Each row links to a full guide with syntax, examples, and FAQs.
Learn how categories, tags, and taxonomies work on WordPress Category. Use this page when you need one function, such as the_category(), single_term_title(), or wp_tag_cloud().
Start with the_category() and the_tags(). Then learn single_term_title(), term_description(), wp_list_categories(), and wp_tag_cloud().
How to Call a Category Function
Post term tags go inside The Loop. Archive title tags go in archive templates. Functions that start with the_ print. Functions that start with get_ return a value.
<?php while ( have_posts() ) : the_post(); ?>
<p><?php the_category( ', ' ); ?></p> <!-- prints category links -->
<p><?php the_tags(); ?></p> <!-- prints tag links -->
<?php $list = get_the_term_list( get_the_ID(), 'genre' ); ?> <!-- returns links -->
<?php endwhile; ?>
<h1><?php single_term_title(); ?></h1> <!-- archive page title -->
<?php wp_tag_cloud(); ?> <!-- tag cloud --> WordPress Category Functions Table
All function guides in this WordPress category series (16 tutorials).
Post terms (in The Loop)
6 functionsShow the categories, tags, and other terms of the current post.
| Function | Description | Tutorial |
|---|---|---|
the_category() | Print the categories of the current post as links or a list. | Read guide |
the_tags() | Print the tags of the current post as links with optional text around them. | Read guide |
the_terms() | Print the linked terms of a post for any taxonomy. | Read guide |
get_the_term_list() | Return linked terms of a post for any taxonomy as one HTML string. | Read guide |
the_taxonomies() | Print all taxonomies and terms of a post in one short sentence. | Read guide |
the_category_rss() | Print the categories of the current post inside an RSS or Atom feed. | Read guide |
Archive titles & descriptions
6 functionsShow the name and description of a category, tag, or term on an archive page.
| Function | Description | Tutorial |
|---|---|---|
single_cat_title() | Print or return the title (name) of the current category archive. | Read guide |
single_tag_title() | Print or return the title (name) of the current tag archive. | Read guide |
single_term_title() | Print or return the title of a category, tag, or custom taxonomy archive. | Read guide |
category_description() | Return the description of a category (current archive by default). | Read guide |
tag_description() | Return the description of a tag (current archive by default). | Read guide |
term_description() | Return the description of any term: category, tag, or custom taxonomy. | Read guide |
Lists, dropdowns & clouds
4 functionsBuild category lists, select boxes, and tag clouds for sidebars and forms.
| Function | Description | Tutorial |
|---|---|---|
wp_list_categories() | Print or return an HTML list of categories with links. | Read guide |
wp_dropdown_categories() | Create an HTML select box (drop-down) of categories. | Read guide |
wp_tag_cloud() | Fetch tags and print a tag cloud with different font sizes. | Read guide |
wp_generate_tag_cloud() | Build tag cloud HTML from an array of term objects. | Read guide |
Frequently Asked Questions
Start with category_description()
Get the description of a category, the first guide in the sidebar.
15 people found this page helpful
