內容簡介
使用 Anything Block 外掛,您可以列印存儲在設置、文章元數據甚至主題修飾中的值。
在“輸出 HTML”區塊中開始鍵入,您的 HTML 會直接呈現。您可以使用 {data} 做為您已保存數據的佔位符。
當與 Gutenberg Full-Site-Editing 實驗一起使用時,該區塊可用於將各種數據添加到您的模板中。如果您的網站上安裝了 WooCommerce 或 EDD,甚至可以使用它來使用文章元數據創建自定義產品模板。
範例
列印網站名稱: {data.setting.blogname}
列印指向網站首頁的鏈接,以網站名稱作為文本: <a href="{data.setting.home}">{data.setting.blogname}</a>
列印文章 ID: {data.post.ID}
列印主題修飾: {data.themeMod.my_theme_mod}
列印文章元數據: {data.post.meta.my_post_meta}
外掛標籤
開發者團隊
原文外掛簡介
With the Anything Block you can print values stored in settings, post-meta and even theme-mods.
Start typing in the “Output HTML” field of the block and your HTML will be rendered directly. You can use {data} as a placeholder for your saved data.
Used in conjunction with the Gutenberg Full-Site-Editing experiment this block can be used to add various data to your templates. In WooCommerce or EDD are installed on the site, it can be even used to create custom templates for your products using the post-meta.
Examples
Print the site-name: {data.setting.blogname}
Print a link to the site-home, with the site-name as text: {data.setting.blogname}
Print the post-ID: {data.post.ID}
Print a theme-mod: {data.themeMod.my_theme_mod}
Print a post-meta: {data.post.meta.my_post_meta}
