
內容簡介
這是一個針對Advanced Custom Fields WordPress 外掛的擴充套件,除非已安裝且啟用 Advanced Custom Fields,否則對 WordPress 不提供任何功能。
Location 欄位提供:
一個搜尋欄位,您可以輸入座標或地址,然後按 Enter 鍵。
一個 Google 地圖,您可以點擊所需位置。
在兩種情況下,Google 都會找到該位置並返回座標和完整地址(如果您需要完整地址)。一個標記會被添加到所需位置。
Source Repository on GitHub
https://github.com/julienbechade/acf-location-field
Bugs, Questions or Suggestions
https://github.com/julienbechade/acf-location-field/issues
使用說明
請確認您先閱讀Advanced Custom Fields 的文件。
後端
Location 欄位有 3 個選項:
地圖地址讓您選擇要在前端返回的值:
座標&地址
座標
地圖中心讓您設置用於定位空白地圖的座標。
地圖縮放。
前端
檢索前端的值取決於地圖地址選項。
座標&地址
$location = get_field(‘location’); echo $location[‘address’]; echo $location[‘coordinates’];
座標
the_field(‘location’);
外掛標籤
開發者團隊
② 後台搜尋「Advanced Custom Fields – Location Field add-on」→ 直接安裝(推薦)
原文外掛簡介
This is an add-on for the Advanced Custom Fields
WordPress plugin and will not provide any functionality to WordPress unless Advanced Custom Fields is installed
and activated.
The Location field provides:
a search field where you can type in some coordinates or an address and hit Enter.
a Google map which you can click at the desired location.
In both cases, Google will find the location and return the coordinates and the complete address, if you want it complete. A marker will be added at the desired location.
Source Repository on GitHub
https://github.com/julienbechade/acf-location-field
Bugs, Questions or Suggestions
https://github.com/julienbechade/acf-location-field/issues
Usage
Make sure you read the Advanced Custom Fields‘s documentation first.
Back-end
The Location field comes with 3 options:
The map address let you choose the value(s) to return on the front-end:
Coordinates & address
Coordinates
The map center let you set the coordinates used to center the initial blank map.
The map zoom.
Front-end
Retrieving the value(s) on the front-end differs according to the Map address options.
Coordinates & address
$location = get_field(‘location’); echo $location[‘address’]; echo $location[‘coordinates’];
Coordinates
the_field(‘location’);
