
內容簡介
WP Custom Data 是一個 WordPress 小工具,可在您的 WordPress 網站中增加自定義欄位。這些自定義欄位可以輕鬆地在主題或外掛中的任何部分中使用。例如,如果您想要在頁尾中添加您的地址,但主題沒有地址欄位,您只需安裝 WP Custom Data,啟用該外掛,進入小工具區段,在任何位置添加 WP Custom Data,編寫一個或多個地址並儲存。現在,WordPress 知道您的地址了,您可以在任何地方使用這些欄位。想在頁尾中使用它嗎?在 footer.php 中編寫 PHP 代碼:
$list = get_option('wp-custom-data');
然後,當您想顯示地址(自定義欄位)時,使用:
echo $list['rowX'];
其中 X 是您在 WP Custom Data 中編寫地址的列數。
外掛標籤
開發者團隊
原文外掛簡介
WP Custom Data is a WordPress widget which adds custom fields in your WordPress site. The custom fields can be simply usable in every section of your theme or in every plugin. For example if you want to add your address to the footer but the theme has not got an address field, you can simply install the WP Custom Data, enable the plugin, go in the widget section, add the WP Custom Data in any section (no matter where), write the address in one or more rows and save. Now WordPress knows your address and you can use this fields wherever you want. Do you want to use it in the footer? Open footer.php and write the PHP code:
$list = get_option('wp-custom-data');
where you want then, to display the address (the custom fields), use
echo $list['rowX'];
where X is the number of the row in the WP Custom Data where you have written the address.
