內容簡介
替換短代碼為首頁自訂欄位。
此外掛允許您這樣編寫頁面內容:
「通過電子郵件聯繫我們公司[company_name]:[email]。」
包含這些短代碼的文本可以在整個網站的任意頁面上定義。
所有短代碼的值都受一個位置的控制:您網誌的首頁自訂欄位。以上面的例子為例,首頁將有稱為「company_name」和「email」的自訂欄位,其值分別為「Example Company Name」和「[email protected]」。
此外掛要求在「設定-閱讀」中將 WordPress 設定為在主頁上顯示靜態頁面。
然後,對於在首頁輸入的所有自訂欄位,此外掛將在所有頁面中查找短代碼(在輸出後)並分別使用相關的自訂欄位值替換它們。
如果您想要使用任意數量的短代碼或模板文本填充多個頁面並且所有值都可以在一個地方替換,則此功能非常有用。
-作者:Phil Freo
外掛標籤
開發者團隊
原文外掛簡介
Replaces Shortcodes with Homepage Custom Fields.
This plugin allows you to write your page content like this:
“Contact our company, [company_name], by email at: [email].”
Text with these shortcodes can be defined on any number of pages throughout your site.
The values of all of the shortcodes are controlled in a single location: the Custom Fields of your blog’s home page. For the above example, there would be Custom Fields on the home page called “company_name” and “email” with the values, respectively, of “Example Company Name” and “[email protected]”.
This plugin requires that you have WordPress set to show a static Page on the home page under Settings->Reading and “Front page”.
So then, for all the custom fields entered on the home page, this plugin looks for shortcodes (in all pages) and replaces each of their values, upon output, with the relevant custom field value.
This is useful for if you want to fill many pages with text that includes an arbitrary number of shortcodes or template text and have all the values can be replaced in one place.
-By Phil Freo
