[WordPress] 外掛分享: Random Gallery

WordPress 外掛 Random Gallery 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Random Gallery」是 2015-03-22 上架。
  • 目前有 200 個安裝啟用數。
  • 上一次更新是 2023-04-02,距離現在已有 763 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
  • 有 11 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

david-g |

外掛標籤

images | random | subset | gallery | category |

內容簡介

隨機圖庫(Random Gallery)讓您每次刷新頁面時顯示不同的圖片子集。只需告訴它您想要從哪些圖像中選取,以及同時顯示的數量即可。

基本操作

隨機圖庫可以使用傳統的短碼(shortcode)。您可以使用ids或category參數指定圖像池,再用shownum參數指定要顯示多少圖像。

以下是ids方法的範例:

[random-gallery ids='101,102,103,104,105' shownum='3']

這個範例中,列表中有五張圖像,但同時只會顯示三張。

以下是category方法的範例:

[random-gallery category='myCategory' shownum='3']

隨機圖庫也可以處理普通的 Gallery 短碼參數,例如type、columns、size和link:

[random-gallery category='myCategory' shownum='3' columns='1' size='medium']

您可以在各種區塊中使用短碼。不過,最好使用短碼小工具。

ids 方法的詳細說明

ids參數是您要選取圖像列表。要建立這個列表,您需要知道 WordPress 為每個圖像指定的編號。

有些外掛可以讓您直接在媒體庫中查看這些編號。您可以在外掛目錄中搜索「reveal ids」來找到這些外掛。

否則,您可以手動查找編號:

打開您的媒體庫
點擊一張照片
會彈出相關詳情
您的網址欄會顯示這樣的網址:https://www.example.com/wp-admin/upload.php?item=101
取出 URL 結尾的數字(如這個例子中的 101),並將這個數字添加到ids
對於每張要包含的照片,重複此過程

category 方法

預設情況下,媒體庫中並沒有可用的分類。不過,有外掛可以啟用分類。您可以在外掛目錄中搜索「media library categories」來尋找這些外掛。

啟用分類後,您可以創建一個分類,將圖像添加到其中,然後通過名稱在短碼中指定。

大括號引號問題

需注意的一個棘手問題是大括號引號。WordPress 喜歡將直引號(')轉換為彎引號(‘)。這通常很好,但隨機圖庫只能處理直引號。

確保只使用直引號的最簡單方法是將短碼放在短碼小工具中,然後直接在小工具中重新輸入所有引號。

感謝

希望隨機圖庫對您有所幫助。如果有任何問題,請給我發電子郵件。謝謝!

原文外掛簡介

Random Gallery lets you display a different subset of your images every time your page is refreshed. Just tell it which ones you want it to pick from and how many you want to show at a time.
The Basics
Random Gallery works with an old fashioned shortcode. You specify the pool of images with the ids or category parameter. Then you specify how many you want to show with the shownum parameter.
Here’s an example of the ids method:
[random-gallery ids='101,102,103,104,105' shownum='3']

Note there are five images in the list but only three will be shown at a time.
And here is an example of the category method:
[random-gallery category='myCategory' shownum='3']

Random Gallery can handle the ordinary Gallery shortcode parameters columns, size, and link:
[random-gallery category='myCategory' shownum='3' columns='1' size='medium' link='none']

You can put shortcodes in all kinds of blocks, but it’s best to use the shortcode widget.
ids method details
The ids parameter is the list of images you want to draw from. To build up the list, you need the numbers that WordPress assigns to each of your images.
There are plugins that let you see these numbers directly in the Media Library. Try searching the plugins directory for “reveal ids”.
Otherwise, you can find them manually:

open up your Media Library
click on a photo
the Attachment Details will pop up
the URL in your address bar will look like this: https://www.example.com/wp-admin/upload.php?item=101
take the number at the end of the URL (in this case 101) and add that number to ids
repeat this process for each photo you want to include

category method
By default, categories are not available in the Media Library. However, there are plugins that will enable them. Try searching the plugins directory for “media library categories”.
Once you have categories enabled, you can create a category, add images to it, and specify it in the shortcode by name.
Curly Quotes Issue
One tricky thing to watch out for is curly quotation marks. WordPress likes to replace straight quotes (') with curly quotes (‘). This is usually a good thing, but Random Gallery can only handle straight quotes.
The easiest and best way to make sure you’re only using straight quotes is to put your shortcode in a shortcode widget, then re-type all the quotes directly in the widget.
Thanks
I hope Random Gallery works for you. If you have any trouble, just shoot me an email. Thanks!

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Random Gallery」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


00.01 |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon