Taxonomy Term Descriptions & WordPress Archives

Give site owners the option to display taxonomy term descriptions on archive templates.

  • Use the term_description() function to display optional taxonomy term descriptions on a taxonomy archive page in WordPress.
  • It works well in the archive.php or taxonomy.php theme templates, but can be used on other templates too.
  • For categories and tags specifically, use the tag_description() and category_description() functions instead.
  • Consult the WordPress template hierarchy to learn which built-in taxonomy templates your theme can leverage.
  • All code samples for this post have been moved to a GitHub Gist.

All code samples have been moved to a GitHub Gist.

If you’re working with custom taxonomies in WordPress, it’s nice to provide site owners the option to display term descriptions in their theme. Optional term descriptions can easily be displayed on a taxonomy archive page using the term_description() function:

I generally use this bit of code on the archive.php or taxonomy.php templates in a theme, but it can be used on other templates as well. Check out the WordPress template hierarchy for more information on the built-in taxonomy templates that can be leveraged within a WordPress theme.

If you’re looking to use this method with categories or tags, you may want to check out the tag_description() and category_description() functions.

More on Taxonomy Archives

Resume