What Is Template in WordPress? How to Use Templates in WordPress

When you buy, sign up, or register through our links, we may earn a commission. Learn More ›

Understanding WordPress Taxonomies and Terms

Within the WordPress platform, ‘terms’ is the nomenclature used for the elements that populate a taxonomy.

Consider a website that categorizes content under headings such as books, politics, and blogging. Here, ‘category’ is the overarching taxonomy, and the individual headings are the terms.

Prior to the advent of custom taxonomies, WordPress utilized specific template tags for the purpose of displaying categories and tags. However, with the emergence of custom taxonomies, new template tags were developed to facilitate the display of terms within these taxonomies. These template tags are versatile and can be applied to both categories and tags, which are the default taxonomies embedded in WordPress.

WordPress includes functions designed to showcase the terms associated with a custom taxonomy. One such function is the_terms(), which allows for customization in the presentation of terms. An illustration of how the_terms() function is implemented is provided below:

1
<?php the_terms( $post->ID, 'category', 'categories: ', ' / ' ); ?>