內容簡介
Simple Google Photos Grid 是一個簡單且不附帶花哨功能的 WordPress 外掛,讓您可以透過使用小工具或短代碼,在您的網站上顯示 Google Photos 的相簿。這個外掛只有一種版面配置選項:網格。只需要一個必要的選項:相簿的 URL。這就是這個外掛的所有用法,簡單易用。 您可以觀看插件示範以及更多詳情,這個外掛的原始碼也相關於 Github 上。
注意事項
您的 Google Photos 上的相簿必須是「公開的」,這表示您需要進入 Google Photos 網站並開啟「分享選項」,也就是「所有人皆可透過連結檢視這些照片,以及被邀請或加入的人。」
此外掛需要 curl 或相似工具,以擷取照片連結。
作者不提供技術支援。新功能可能不會被加入。您可以自由發問或另外創建出自己的版本。
小工具
移至「外觀」->「小工具」,一個名為「Simple Google Photos Grid」的新小工具應該會顯示在可用清單中。將其拖曳至您想要的小工具區域,並進行所需的配置。
標題:顯示在您網站上該小工具的標題。預設為空。
相簿 URL:您公開相簿在 Google Photos 上的完整網址。理想上應該是一個簡短的「共用」連結(例如 https://photos.app.goo.gl/G8EOLs5YtESchh4g1),不過任何 Google Photos 的網址都可以。
顯示照片數量:偶數可能會更適合。最多可以顯示多少照片則未知,但數量應該相當有限。
每列顯示幾張照片:每列顯示幾張照片呢?應該要選擇一個適合「顯示照片數量」的數字。
快取時間(以分鐘為單位):快取照片連結在重新向 Google 中查詢前,要將其快取多久。若為 0 則代表不使用快取。
短代碼
將短代碼放在文章、頁面或佈景主題中。
[simple_google_photos_grid album-url=”https://photos.app.goo.gl/G8EOLs5YtESchh4g1″]
可用的屬性包括:
– album-url:(必要)指向公開 Google Photos 相簿的網址
– number-photos:(選擇性)要顯示的照片數,預設為 4
– number-photos-per-row:(選擇性)每列要顯示幾張照片,預設為 2
– cache-interval:(選擇性)Google Photos 錯誤時存取照片連結的緩存時間(以分鐘為單位),預設為 15
[simple_google_photos_grid album-url="https://photos.app.goo.gl/G8EOLs5YtESchh4g1" number-photos="6" number-photos-per-row="3" cache-interval="120"]
外掛標籤
開發者團隊
原文外掛簡介
A simple, no-frills solution to display a Google Photos album on your site using a widget or a shortcode. There is only one layout option: grid. There is only one required attribute: album url. That’s it, that easy. See a demo and read more about the plugin. The code is also available on Github.
Notes
Your album on Google Photos must be “public”, which means you need to go into Google Photos on the web and set “Sharing options” to on, i.e. “Anyone with the link can see these photos and the people who’ve been invited or joined.”
Requires curl or similar to fetch the photo urls.
No support is provided. Probably no features will be added. You are free to ask, or to fork. Pull requests accepted.
Widget
Go to Appearance -> Widgets and a new widget named Simple Google Photos Grid should be available to use. Drag to your desired widget area and configure.
Title: Heading of the widget on your site. Default to empty.
Album URL: The full URL to your public gallery on Google Photos. URL must use one of the following domains: ‘photos.app.goo.gl’ or ‘photos.google.com’. Ideally should be the short, “shared” link (such as https://photos.app.goo.gl/G8EOLs5YtESchh4g1z).
Num Photos to Show: Even numbers probably work best. There’s a maximum number, not sure what it is, but it’s pretty low.
Num Photos per Row: How many photos to show per row? Probably some number that works well with Num Photos.
Cache Interval (in minutes): How long to cache photo URLs before checking the album on Google again. 0 for no cache.
Shortcode
Place the shortcode in a post, page or theme.
[simple_google_photos_grid album-url=”https://photos.app.goo.gl/G8EOLs5YtESchh4g1″]
Available attributes are:
– album-url: (required) the url to a public Google Photos album, domain must be one of ‘photos.app.goo.gl’ or ‘photos.google.com’
– number-photos: (optional) number of photos to display, defaults to 4
– number-photos-per-row: (optional) number of photos per row, defaults to 2
– cache-interval: (optional) length, in minutes, to cache the photo urls retrieved from Google, defaults to 15
[simple_google_photos_grid album-url="https://photos.app.goo.gl/G8EOLs5YtESchh4g1" number-photos="6" number-photos-per-row="3" cache-interval="120"]
