Post term tags go in single.php and the post loop. Archive title tags go in category.php, tag.php, taxonomy.php, or archive.php. List and cloud tags are often used in sidebars.
Syntax
Syntax
A typical post footer and archive header in a theme:
WordPress
<?php // inside The Loop ?>
<p><?php the_category( ', ' ); ?></p>
<p><?php the_tags(); ?></p>
<?php // in an archive template ?>
<h1><?php single_term_title(); ?></h1>
<?php echo term_description(); ?>
Reference
Category vs Tag vs Custom Taxonomy
All three group your content. They differ in how you plan them.
Type
Best for
Hierarchy
Name
Category
Main topics of your site, such as News or Tutorials.
Yes. Categories can have child categories.
category
Tag
Small keywords for details, such as PHP or SEO.
No. Tags are flat.
post_tag
Custom taxonomy
Your own groups, such as Genre or Skill, often for custom post types.
Your choice when you register it.
Any name you register
Map
Function Groups at a Glance
Pick the group that matches the job, then open the guide you need.
Group
Typical job
Start here
Post terms
Show the categories, tags, or custom terms of one post.
Categories are broad groups and can have parent and child categories. Tags are small keywords with no hierarchy. Use categories for the main topics and tags for details.
A custom taxonomy is your own way to group content, such as genre, topic, or skill. It works like categories or tags, but you create it with register_taxonomy().
A term is one item inside a taxonomy. News is a term of the category taxonomy. PHP is a term of the post_tag taxonomy.
Use the_category() for categories and the_tags() for tags. Use the_terms() when you work with a custom taxonomy.
Use single_cat_title() for categories, single_tag_title() for tags, or single_term_title() for any taxonomy.
Open the WordPress Category Functions index. It lists all sixteen guides in simple tables with short descriptions.