Term
Access taxonomy term data. Available on term archive pages and inside term Loop blocks (via the loop data alias).
All Fields
| Field | Arguments | Returns | Description |
|---|---|---|---|
id | — | int | Term ID |
name | — | string | Term name |
slug | — | string | Term slug |
description | — | string | Term description (filtered, ready to render) |
count | — | int | Post count |
link | — | string | Term archive URL |
path | — | string | Term archive path |
edit_link | — | string | null | Admin edit URL (null when not authorized) |
taxonomy | — | string | Taxonomy slug (e.g. 'category') |
children | — | array | Child terms |
posts | query, post_type | iterable | Posts in this term |
can_edit | — | bool | Current user can edit |
meta | field_name | mixed | Term meta value |
raw_meta | field_name | mixed | Unescaped meta value |
has_field | field_name | bool | Check if field exists |
Raw Database Fields
Direct read access to the underlying WP_Term columns:
| Field | Returns | Description |
|---|---|---|
ID | int | Term ID (alias of id) |
term_id | int | Term ID |
term_taxonomy_id | int | Term taxonomy ID |
term_group | int | Term group |
parent | int | Parent term ID, 0 if no parent |
Taxonomy
term.taxonomy returns the taxonomy slug as a string. To access the taxonomy object (for the human-readable label, hierarchy info, etc.) use the get_taxonomy() function:
{{ term.taxonomy }} <!-- 'category' -->
{{ get_taxonomy(term.taxonomy).label }} <!-- 'Categories' -->
{{ get_taxonomy(term.taxonomy).labels.singular_name }}
Hierarchy
term.parent returns the parent term ID (or 0 if there is no parent). Use get_term() to chain into the parent term object:
{{ term.parent }} <!-- e.g. 5, or 0 if no parent -->
{{ get_term(term.parent).name }} <!-- Parent term name -->
{{ get_term(term.parent).link }}
{{ term.children }}
Posts
term.posts returns an iterable collection of posts belonging to this term. It supports length and count, and accepts an optional query (limit, args) plus a post type override as a 2nd argument:
{{ term.posts }} {# All posts #}
{{ term.posts(5) }} {# Limit to 5 #}
{{ term.posts({orderby: 'title'}) }} {# Custom query #}
{{ term.posts({posts_per_page: 5}, 'product') }} {# Override post type #}
{{ term.posts.length }} {# How many posts in the result #}
Permissions
{{ term.can_edit }}
Custom Fields (Meta)
{{ term.meta('icon') }}
{{ term.meta('color') }}
{{ term.meta('featured_image') }}
meta('key') integrates with ACF, MetaBox, JetEngine, and Pods. Private meta keys (starting with _) are blocked for security.
Common Patterns
Display term with post count
{{ term.name }} ({{ term.count }})
Build breadcrumb with parent
{% if term.parent %}{{ get_term(term.parent).name }} / {% endif %}{{ term.name }}
Link to term archive
<a href="{{ term.link }}">{{ term.name }}</a>
Show taxonomy label
{{ get_taxonomy(term.taxonomy).label }}: {{ term.name }}