显示您最近发布的文章列表。
属性
通过块.json 中的 attributes 属性定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
categories | array | — | — |
selectedAuthor | number | — | — |
postsToShow | number | 5 | — |
displayPostContent | boolean | false | — |
displayPostContentRadio | string | "excerpt" | — |
excerptLength | number | 55 | — |
displayAuthor | boolean | false | — |
displayPostDate | boolean | false | — |
order | string | "desc" | — |
orderBy | string | "date" | — |
displayFeaturedImage | boolean | false | — |
featuredImageAlign | string | — | 枚举:left、center、right |
featuredImageSizeSlug | string | "thumbnail" | — |
featuredImageSizeWidth | number | null | — |
featuredImageSizeHeight | number | null | — |
addLinkToFeaturedImage | boolean | false | — |
支持功能
通过块.json 中的 supports 属性定义。
anchor:truealign:truehtml:falselayout:truebackground:backgroundImage:truebackgroundSize:truegradient:true
color:dimensions:minHeight:trueminWidth:true
spacing:margin:truepadding:trueblockGap:{"__experimentalDefault":"1.25em"}
typography:fontSize:truelineHeight:true
shadow:trueinteractivity:clientNavigation:true
块标记
这是一个 动态块。它在服务器上渲染,不会将 HTML 保存到文章内容中。
在文章内容中,它存储为块注释:
<!-- wp:core/latest-posts {"postsToShow":5,"displayAuthor":false,"displayPostDate":false} /-->
来源
- block.json (参考)
- 源目录 — 浏览
edit和save源文件、index.php等。