Terms Query
An advanced block that allows displaying taxonomy terms based on different query parameters and visual configurations.
- Name:
core/terms-query - Category: theme
- API Version: 3
- Block Type: Static (saved in post content)
- Keywords:
terms,taxonomy,categories,tags,list
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
termQuery |
object |
{"perPage":10,"taxonomy":"category","order":"asc","orderBy":"name","include":[],"hideEmpty":true,"showNested":false,"inherit":false} |
— |
tagName |
string |
"div" |
— |
Supports
Defined via the supports property in block.json.
anchor:truealign:"wide","full"html:falselayout:truespacing:padding:truemargin:trueblockGap:true
interactivity:true
Context
Defined via the usesContext and providesContext properties in block.json.
Uses context:
templateSlug
Provides context:
termQuery→ attributetermQuery
Block Markup
This is a static block. The markup is saved directly in the post content.
<!-- wp:terms-query -->
<div class="wp-block-terms-query"></div>
<!-- /wp:terms-query -->
Source
- block.json (reference)
- Source directory — browse the
editandsavesource files,index.php, and more.
这篇文档对你有帮助吗?
谢谢你的反馈!