前言介紹
- 這款 WordPress 外掛「Multi Image Metabox」是 2012-12-16 上架。
- 目前有 10000 個安裝啟用數。
- 上一次更新是 2017-11-28,距離現在已有 2713 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 有 11 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
images | metabox | multiple | pictures | multiple post thumbnail |
內容簡介
這個外掛新增了一個 metabox,允許在一篇文章中上傳和連結多張圖片。
圖片是透過 meta_value(和附件 ID)連結。它們可以使用拖放重新排序。
允許的圖片數量和相關的文章類型可以使用 hooks 覆寫。
外掛包括許多檢索已連結圖片的功能。
如需有關使用本外掛的更多信息,請參閱“其他注記”部分的連結。
設定相關文章類型
將以下代碼複製到主題的 functions.php 檔案中:
設定允許的圖片數量
將以下代碼複製到主題的 functions.php 檔案中:
‘_image1’,
‘image2’ => ‘_image2’,
);
return $picts;
}
?>
設定允許的圖片數量,取決於文章類型
將以下代碼複製到主題的 functions.php 檔案中:
add_filter(‘list_images’,’my_list_images’,10,2);
function my_list_images($list_images, $cpt){
global $typenow;
if($typenow == “my_custom_post_type” || $cpt == “my_custom_post_type”)
$picts = array(
‘image1’ => ‘_image1’,
‘image2’ => ‘_image2’,
‘image3’ => ‘_image3’,
);
else
$picts = array(
‘image1’ => ‘_image1’,
‘image2’ => ‘_image2’,
‘image3’ => ‘_image3’,
‘image4’ => ‘_image4’,
‘image5’ => ‘_image5’,
‘image6’ => ‘_image6’,
‘image7’ => ‘_image7’,
‘image8’ => ‘_image8’,
);
return $picts;
}
get_images_ids()
此功能必須在模板文件或任何函數中使用。
它返回連結附件的 ID 數組。
它有兩個參數,分别是:
是否包含縮略圖?(布林值)如果為 true,則在返回的數據中包含縮略圖
ID(整數),用於定位與特定文章相關聯的圖像
45,
‘image1’ => 5,
‘image2’ => 6,
‘image3’ => 12,
‘image6’ => 20,
‘image7’ => 15
);
//未填圖片未返回
?>
get_images_src()
此功能必須在模板文件或任何函數中使用。
它按順序返回關聯附件的 URI 和尺寸的數組。
它有三個參數,分別是:
要返回的大小(字符串)
是否包含縮略圖?(布林值)如果為 true,則在返回的數據中包含縮略圖
ID(整數),用於定位與特定文章相關聯的圖像
array(
[0] => ‘http://url_of_the_medium_pict.jpg’,
[1] => 340,
[2] => 200,
原文外掛簡介
This plugin add a metabox which allox to upload and link multiple images to one post.
Pictures are linked by the way of meta_value (and attachments ID). They can be reordered using drag and drop.
Number of allowed pictures and concerned post types can be overited using hooks.
Plugin includes many functions to retrieve linked pictures.
For more information on using the plugin, refer to the section “Other Notes”.
Set concerned post types
Paste this into your theme’s functions.php file :
Set allowed number of picts
Paste this into your theme’s functions.php file :
‘_image1’,
‘image2’ => ‘_image2’,
);
return $picts;
}
?>
Set allowed number of picts, depending to the post_type
Paste this into your theme’s functions.php file :
add_filter(‘list_images’,’my_list_images’,10,2);
function my_list_images($list_images, $cpt){
global $typenow;
if($typenow == “my_custom_post_type” || $cpt == “my_custom_post_type”)
$picts = array(
‘image1’ => ‘_image1’,
‘image2’ => ‘_image2’,
‘image3’ => ‘_image3’,
);
else
$picts = array(
‘image1’ => ‘_image1’,
‘image2’ => ‘_image2’,
‘image3’ => ‘_image3’,
‘image4’ => ‘_image4’,
‘image5’ => ‘_image5’,
‘image6’ => ‘_image6’,
‘image7’ => ‘_image7’,
‘image8’ => ‘_image8’,
);
return $picts;
}
get_images_ids()
This function have to be used into a template file, or any function.
It return an array of the linked attachments’s ID.
It take two arguments whose are :
include the thumbnail ? (boolean) if true include the thumbnail in the returned datas
ID (integer) for targeting images linked to a specific post
45,
‘image1’ => 5,
‘image2’ => 6,
‘image3’ => 12,
‘image6’ => 20,
‘image7’ => 15
);
//Empty pictures ar not returned
?>
get_images_src()
This function have to be used into a template file, or any function.
It return an array of URIs and dimension for the linked attachments’s, by order.
It take three agruments whose are :
size (string) the size to return
include the thumbnail ? (boolean) if true include the thumbnail in the returned datas
ID (integer) for targeting images linked to a specific post
array(
[0] => ‘http://url_of_the_medium_pict.jpg’,
[1] => 340,
[2] => 200,
[3] => false //I’ve no idea what is it…
),
‘image2’ => array(
[0] => ‘http://url_of_the_medium_second_pict.jpg’,
[1] => 340,
[2] => 200,
[3] => false //I’ve no idea what is it…
)
);
?>
get_multi_images_src()
Same as get_image_src(), but return two sizes for all the pictures.
It take for agruments whose are :
size (string) the size to return
size2 (string) another size to return
include the thumbnail ? (boolean) if true include the thumbnail in the returned datas
ID (integer) for targeting images linked to a specific post
array(
[0] => array(
[0] => ‘http://url_of_the_medium_pict.jpg’,
[1] => 340,
[2] => 200,
[3] => false //I’ve no idea what is it…
),
[1] => array(
[0] => ‘http://url_of_the_full_pict.jpg’,
[1] => 1020,
[2] => 600,
[3] => false //I’ve no idea what is it…
),
),
‘image2’ => array(
[0] => array(
[0] => ‘http://url_of_the_medium_second_pict.jpg’,
[1] => 340,
[2] => 200,
[3] => false //I’ve no idea what is it…
),
[1] => array(
[0] => ‘http://url_of_the_second_full_pict.jpg’,
[1] => 1020,
[2] => 600,
[3] => false //I’ve no idea what is it…
)
)
);
//Empty pictures ar not returned
?>
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Multi Image Metabox」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.3.2 |
延伸相關外掛(你可能也想知道)
FancyBox for WordPress 》本外掛能讓FancyBox輕鬆整合到您的部落格:上傳,啟用,完成。您也能選擇進行更多的設置。, 您幾乎可以對Fancybox lightbox的所有屬性進行自定義:邊框、邊緣...。
jQuery Colorbox 》查看最新的 WordPress 外掛優惠。, 一个用于 WordPress 的 Colorbox/Lightbox 外掛。, jQuery Colorbox 提供了 11 个不同的主题可供选择。请查看我的网站。, ...。
Pixabay Images 》Pixabay Images 是一款 WordPress 外掛,讓您能夠從 Pixabay 中選擇 CC0 公有領域圖片,在部落格上輕鬆插入。這些圖片可安全使用,且不需要歸屬或連結回原始...。
Images to WebP 》統計顯示,WebP 格式可以在不損失圖像質量的前提下減輕網頁一半以上的負載。, 將 PNG、JPG 和 GIF 圖像轉換為 WebP,加快您的網站速度,減少訪問者下載數據,...。
ImageInject 》ImageInject(曾名為 WP Inject)允許您輕鬆地在 WordPress 文章中插入照片和圖像,只需輸入您想要的任何關鍵字,就可以在成千上萬的免費創作共用圖像中搜索...。
Post Gallery 》, Post Gallery 可讓您在任何文章類型中添加圖片、照片和視頻的圖庫;每個圖庫都可在文章表單中創建和更新,比許多其他圖庫外掛更簡單、更靈活。, 使用 Post ...。
Social Photo Fetcher 》Social Photo Fetcher(以前稱為「Facebook Photo Fetcher」)使您可以從 Facebook 相簿中快速輕鬆地生成 WordPress 照片庫。, 靈感來自於Fotobook,但其方法...。
Add Local Avatar 》此外掛可讓使用者新增本地 (私人) 頭像,如果您的使用者不想使用全域頭像、不熟悉 Gravatar 設定或只是想為您的部落格使用私人頭像,或任何其他原因,這個外...。
Watermark RELOADED 》這個外掛允許你給上傳的圖片打浮水印。你可以使用不同的字體、顏色來創建浮水印,, 並將這些浮水印應用於不同的圖像大小(縮略圖、中等大小、大尺寸、完整尺...。
Photection – Easy image protection for WordPress 》Photection 是一款外掛,可以禁止使用者在你的網站上點選圖片右鍵進行複製,而不會影響網站的可用性(在其他地方點右鍵仍然可以使用!)。, 當使用者點擊圖片...。
Img Title Removal 》通常圖片的title屬性在滑鼠懸停在圖片上時會顯示。透過刪除圖片中的title屬性標籤,可以輕鬆避免此行為。但是,如果網站已經擁有數百張圖片,逐一刪除每個tit...。
DX-Watermark 》這款 WordPress 外掛可以自動地為圖片添加水印,可選擇文字或圖片兩種類型。, 詳細資訊請參閱:http://www.daxiawp.com/dx-watermark.html, 任意段落 1。
Comment Image 》Comment Image 讓博客讀者在留言時附加一張圖片。, 支援的格式為 JPG、PNG、GIF。, 上傳的圖片會作為縮圖(可設定最大尺寸)顯示在留言文字下方,並連結到原...。
Automatic Featured Image Posts 》Automatic Featured Image Posts 可以在每次上傳圖像時創建一個新的帶有特色圖像的文章。透過外掛設置頁面,您可以將圖像設置為發佈,並將其分配給您現有的自...。
ThickBox 》這款外掛能讓你在博客中嵌入 ThickBox。只需要在需要的地方插入符合 ThickBox 規格的標記就可以了。該外掛非常輕量級,但以下是一些功能:, , 提供專家模式,...。