Term
Single term entity
Properties & methods
Property | Type | |
---|---|---|
ID | Term ID | int |
ancestor | Retrieves the root ancestor of a term | object |
ancestors(reverse) | Retrieves the ancestors of a term | array |
children(args) | Get term children | array |
content(nl2br) | Get term description | string |
count | Related post count | int |
depth | Hierarchical depth | int |
excerpt | Get filtered term description | string |
link | Term url | string |
custom_fields(name) | Get ACF value | mixed |
meta(name) | Get term meta | mixed |
parameters | Get term url parameters based on rewrite rules | object |
parent | Term parent | object |
path | Relative term link without prefix | string |
posts(post_type, order, limit) | Get related posts, return PostCollection | object |
post_types | Get related post types | array |
slug | Get term slug | string |
taxonomy | Get taxonomy slug | string |
template | Return "template" term meta | string |
thumbnail | Get ACF "thumbnail" field if defined | object |
title | Get term title | string |
has_parent | Check if term has parent | bool |
is_current | Check term id against queried_object_id | bool |
is_public | Return true if taxonomy is viewable | bool |
Examples
Display term meta
Display ACF fields
Display a repeater fields with position and title sub-fields https://www.advancedcustomfields.com/resources/get_field/
Display thumbnail
or using picture twig filter
Query posts : $post_type='post', $orderBy=null, $limit=null, $offset=null
Last updated