[term_description]
The shortcode displays the description of a term (category, tag, or custom taxonomy).
Product
Shortcode Attributes
- id – Term ID. If not provided, the shortcode will use the current term.
- Options: Any numeric value.
- taxonomy – The taxonomy of the term (e.g.,
category,post_tag, or custom taxonomy).- Options: Any text value.
- use_main – Determines whether to use a custom field value
- Default:
on. - Options:
on,off. Specify one only.
- Default:
- label – A label to display before the term description.
- Options: Any text value.
Shortcode Enclosed Content
Any content placed between [term_description] and [/term_description] will be used as a template, where {content} acts as a placeholder for the post description.
Example Usage
Example 1
[term_description label="Category Description: "]
Results
<label>Category Description: </label> This is the description for the current term.
| This example displays the term description with a label “Category Description: ” before it. |
Example 2
[term_description id="123" taxonomy="category"]
Results
This example displays the description of the term with ID 123 from the category taxonomy. |
Example 3
[term_description]<div class="custom-class">{content}</div>[/term_description]
Results
<div class="custom-class">This is the description for the current term.</div>
| This example displays wrap the description in custom HTML by providing content within the shortcode. |
{content} placeholder is used to dynamically insert the term description into custom content.