[WordPress] 外掛分享: Slug for attached posts by image galleries

首頁外掛目錄 › Slug for attached posts by image galleries
20+
安裝啟用
尚無評分
5526 天前
最後更新
問題解決
WordPress 2.5+ v1.0 上架:2011-03-16

內容簡介

Slug4apig (Slug for attached posts from image galleries) 可能是有史以來最簡單的外掛之一,但它對 WordPress 社群來說是必需的。

這個外掛只是為 WordPress 內建的圖庫介面中插入的每個圖像增加一個欄位。就像您輕鬆編輯每個圖像的名稱、說明等一樣,使用 Slug4apig,您可以編輯「友好的 URL」(又稱為 slug)並設置所需的值。

預設情況下,WordPress 內建的圖庫會將附件文章的 slug 設置為您在圖庫中插入的圖像的名稱(減去擴展名)。這是一種相當受限制的方式,因為您的圖像可能會由相機自動分配連續的名稱,例如「S4100001.JPG」。

在前面的例子中,假設您使用自動創建的附件文章,那麼這個文章的 URL 將如下:

http://example.com/2011/03/post-title/S4100001/

而在 Google 等搜索引擎上搜索時將會以 「S4100001」作為頁面標題,對搜索引擎使用者、機器人和 SEO 活動來說是沒有意義的。假設這個圖像是來自一輛自行車,您可能會希望 URL 更有意義,例如:

http://example.com/2011/03/post-title/bike/

這樣更符合 SEO 規範。沒有什麼神奇的,您只需將附件文章的名稱設置為您選擇的名稱即可取代預設的名稱。

請記得使用 slug 名稱來驗證有效的、未保留的字符集。在 URI 中被允許但沒有保留目的的字符稱為未保留字符。這些字符包括大寫和小寫字母、十進制數字、連字號、句點、底線和波浪號。

未來的增強功能

Slug 名稱驗證
批次作業支援

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Slug for attached posts by image galleries」→ 直接安裝(推薦)

原文外掛簡介

Slug4apig (Slug for attached posts from image galleries) is probably the simplest plugin ever seen, though of
imperative need for the WordPress community.
This plugin just adds a field to each image inserted through the WordPress built-in gallery interface. As easy as you edit
the name, description, etc. for each image, with Slug4apig you will be able to edit the friendly URL (aka slug)
and set the desired value.
By default, the WordPress built-in gallery will set the attachment post’s slug to the name of the image you inserted in
the gallery (minus .extension). This is a rather restrictive approach, as your images may have sequencial names
assigned automatically by the photo camera, like “S4100001.JPG”.
In the previous example, an autocreated attachment post would be created under the hypothetical URL:
http://example.com/2011/03/post-title/S4100001/

and a search on, i.e. Google, will show “S4100001” as the title for the page, which is senseless for the search
engine users, robots, and SEO activities in general. Suppose the image is from a bike; then you will like the URL
to be relevant, like:
http://example.com/2011/03/post-title/bike/

wich is SEO friendly. There is no magic, you just set the attachment post name to overwrite the default with the name
of your choice!
Remember to use valid, unreserved characters for the slug. Characters that are allowed in an URI but do not have a
reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period,
underscore, and tilde.
Future enhancements

Slug name validation
Batch jobs support

延伸相關外掛

文章
Filter
Apply Filters
Mastodon