The term Dynamic Shortcode in WordPress provides an advanced mechanism for retrieving fields from terms.
Syntax
{term:field@keyargs}
field
: Specifies the term field to retrieve.keyargs
: A list of key arguments to refine the shortcode behavior. Key arguments are optional.
Key Arguments
id
: Specifies the term ID to fetch data for.
Examples
Basic Term Name Retrieval:
{term:name}
This retrieves the name of the current term.
Fetching Description with Term ID:
{term:description@id=45}
Fetches the description of the term with ID 45.
Retrieving Term Permalink:
{term:permalink@id=12}
Gets the permalink of the term with ID 12.
Displaying Term Count:
{term:count@id=8}
Shows the count of posts associated with the term ID 8.