An advanced block that allows displaying post types based on different query parameters and visual configurations.
- Name:
core/query - Category: theme
- API Version: 3
- Block Type: Hybrid (static save + server enhancements)
- Keywords:
posts,list,blog,blogs,custom post types
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
queryId |
number |
— | — |
query |
object |
{"perPage":null,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null,"parents":[],"format":[]} |
— |
tagName |
string |
"div" |
— |
namespace |
string |
— | — |
enhancedPagination |
boolean |
false |
— |
Supports
Defined via the supports property in block.json.
anchor:truealign:"wide","full"html:falselayout:trueinteractivity:true
Context
Defined via the usesContext and providesContext properties in block.json.
Uses context:
templateSlug
Provides context:
queryIdattributequeryIdqueryattributequerydisplayLayoutattributedisplayLayoutenhancedPaginationattributeenhancedPagination
Block Markup
This is a hybrid block. It saves static markup that the server may enhance during rendering.
<!-- wp:query -->
<div class="wp-block-query"></div>
<!-- /wp:query -->
Source
- block.json (reference)
- Source directory — browse
edit.js,save.js,index.php, and more.