Featured Image with URL

外掛說明

Featured Image with URL

Featured Image with URL 可以使用外部網址圖片做為網站文章、頁面及自訂內容類型 (例如 WooCommerce 的 [商品]) 的精選圖片,同時支援 WooCommerce 的商品圖庫。使用這個外掛,便能輕鬆將網址圖片設定為精選圖片。

外掛功能

  • 為全部內容類型 (包含自訂內容類型) 設定精選圖片。
  • 可使用網址圖片作為 WooCommerce 的商品圖庫。
  • 可使用網址圖片作為 WooCommerce 多規格商品的圖片。
  • 可顯示圖片的不同尺寸,例如縮圖尺寸、中型尺寸或任何自訂尺寸。
  • 輕量化且易於使用。

致謝名單

這個外掛是以 Featured Image by URL 為基礎進行分支開發,感謝原始外掛開發者的傑出工作成果。

參與方式

1.0.4 – 2024-12-06

  • Changed: Bump WordPress “tested up to” version 6.9
  • Dev: Add PHPCS and Plugin Check GitHub action

1.0.3 – 2024-12-09

  • Changed: Bump WordPress “tested up to” version 6.7

1.0.2 – 2024-08-25

  • Added: Update plugin assets GitHub action workflow.
  • Changed: Bump WordPress “tested up to” version 6.6
  • Changed: Bump WooCommerce “tested up to” version 9.2

1.0.1

  • Added: Backward compatibility for the “Featured Image by URL” plugin.

1.0.0

  • Initial Version.

螢幕擷圖

  • 在網址欄位填入外掛圖片網址,點擊 [預覽] 按鈕即可預覽
  • 顯示網址圖片
  • 使用外部網址圖片的 WooCommerce 商品精選圖片及商品圖庫
  • 使用外部網址圖片的 WooCommerce 商品精選圖片在網站前端的顯示結果
  • 外掛設定頁面 ([設定]→[Featured Image with URL])

安裝方式

在網站上直接安裝這個外掛

  1. 登入至網站管理後台,然後前往 [外掛]→[安裝外掛]。
  2. 在搜尋框中輸入「Featured Image with URL」然後點擊 [搜尋] 按鈕。
  3. 在搜尋結果中找到 Featured Image with URL 外掛,然後點擊 [立即安裝]。
  4. 點擊外掛旁的 [啟用] 按鈕即可啟用外掛。

在網站上手動安裝這個外掛

  1. 從 WordPress.org 下載 Featured Image with URL 的安裝套件 ZIP 壓縮檔。
  2. 將外掛安裝套件 ZIP 壓縮檔解壓縮所得的 featured-image-with-url 資料夾上傳至網站的 /wp-content/plugins/ 目錄。
  3. 登入至網站管理後台,然後前往 [外掛] 畫面。
  4. 在清單中找到 Featured Image with URL,然後點擊 [啟用] 按鈕。

常見問題集

這個外掛是否適用於全部佈景主題?

這個外掛能與絕大多數的佈景主題搭配使用,但精選圖片取決於佈景主題的處理方式 (例如無法擴充的 wp_get_attachment_url 函式),因此可能會發生無法搭配使用的狀況如果這個外掛無法在網站上正確執行,請隨時在技術支援論壇提出技術支援需求,我們非常樂於協助使用者解決問題。

使用者評論

2025 年 6 月 2 日
I want to let you know that it is the perfect plugin for remote images. The solution if you are using WP All Import and you get the images from lets say {photos/photo} (this returns all the images separated by comma), is to create two functions that creates the serialized data to use it in custom fields: function get_featured_image($photos) {if (empty($photos)) return ‘NO_PHOTOS’;if (!is_array($photos)) { $photos = explode(‘,’, $photos);}$first = trim($photos[0]);return serialize([ ‘img_url’ => $first, ‘width’ => ”, ‘height’ => ”]);}function get_gallery_images($photos) {if (empty($photos)) return ”;if (!is_array($photos)) { $photos = explode(‘,’, $photos);}if (count($photos) < 2) return ”;$gallery = [];for ($i = 1; $i < count($photos); $i++) { $url = trim($photos[$i]); $gallery[] = [ ‘url’ => $url, ‘width’ => ”, ‘height’ => ” ];}return serialize($gallery);} Then you just create a custom field for the featured image with name “_harikrutfiwu_url” and value: [get_featured_image({photos/photo})] And a custom field for gallery images with name “_harikrutfiwu_wcgallary” and value: [get_gallery_images({photos/photo})] That’s all. Happy Import with this amazing plugin.
2025 年 4 月 20 日
I rarely give reviews but this plugin is my lifesaver and it’s hard not to recommend it. I’m using it for couple of months now and it works perfectly on older and newer vesions of Wordpress. Simple, no 200 pages of settings, just install and use. The only thing that doesn’t work for me is Yoast SEO’s social media image preview which worked with older version of Wordpress but doesn’t work with the latest, sadly. Other than this little thing, it’s simple, small and working well plugin.
2025 年 2 月 24 日
note the woocommerce rest api keys for images:meta_gallery = {“key”: “_harikrutfiwu_wcgallary”,”value”: [{“url”: img_url} for img_url in product_images]}meta_featured = { # thumbnails”key”: “_harikrutfiwu_url”,”value”: product_images[0]}meta_featured_alt = {“key”: “_knawatfibu_alt”,”value”: product_images[0]}meta_images.append(meta_featured)product_data = {“name”: product_title,”type”: “simple”,”regular_price”: str(product_price),”price”: str(product_price),”sku”: str(product_sku),”description”: product_description,”short_description”: product_short,”status”: “publish”,”categories”: category_ids,”meta_data”: meta_images,#”images”: images,”attributes”:attributes_list}

ok

2024 年 12 月 9 日 2 則留言
Full view Image distorted by the wrong width to height display ratio.
閱讀全部 8 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Featured Image with URL〉的開發相關工作。

參與者

〈Featured Image with URL〉外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Featured Image with URL〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄