前言介紹
- 這款 WordPress 外掛「Attach Post Images」是 2014-03-08 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2014-03-09,距離現在已有 4371 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.5 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
tcyr |
外掛標籤
posts | widget | post images | attach images | attach images to post |
內容簡介
這款外掛不同於傳統的方式,在文章內容中插入圖片(附件),這款外掛讓您以一種方式附加圖片到文章中,
可以讓您控制這些圖片在您的佈景主題中的顯示方式。
它會在編輯畫面上新增一個 metabox,讓您可以選擇/上傳圖片(類似於“特色圖片”metabox)。
稍後可以按以下方式取得附加到文章的圖片:
如果您在 WordPress 迴圈內,則可以使用標籤 twp_the_post_images ($size)。
$size(字符串|數組)是一個可選參數(默認值為“縮略圖”),可以取值類似於wp_get_attachment_image_src 函数。
這將返回一個包含有關圖像的信息的對象數組。
您可以直接調用外掛函數 twp_get_post_images ($post_id,$size)。
$post_id(int):必需-文章的 ID。
$size(字符串|數組):是一個可選參數(默認值為“縮略圖”),可以取值類似於wp_get_attachment_image_src 函数。
這將返回一個包含有關圖像的信息的對象數組。
如果您想直接顯示圖像作為無序列表,則可以使用 shortcode [twp_post_images id = post_id size = some_size] 。
此短碼的參數與上述功能的參數相同。
您需要一些 CSS 知識來正確設計返回的無序列表。
函數 twp_the_post_images() 和 twp_get_post_images() 如果未找到圖像會返回空數組,或者每個對象都具有以下屬性:
id:附件 ID
width:圖像的寬度
height:圖像的高度
orientation:圖像的方向(橫向|豎向)
url:圖像的 URL
is_original:(布爾值)如果 $url 是調整大小的圖像,則為 false; 如果是原始圖像,則為 true。
請注意,每次修改圖像選擇時,必須保存/更新文章。
原文外掛簡介
Unlike the traditional way of attaching images (or attachments) to posts by inserting them in the post content, this plugin allows you to attach images to posts in a manner
that lets you control the way the images are later displayed in your theme.
It adds a metabox to the edit screen that lets you select/upload images (similar to the “Featured Image” metabox).
The images attached to a post can then later be gotten by the following means:
If you are in a WordPress loop then you can use the tag twp_the_post_images($size).
$size (string|array) is an optional parameter (defaults to ‘thumbnail‘) and can take values similar to the wp_get_attachment_image_src function.
This will return an array of objects where each object contains information about an image.
You can directly call the plugin function twp_get_post_images($post_id, $size).
$post_id (int): required – the ID of the post.
$size (string|array): is an optional parameter (defaults to ‘thumbnail‘) and can take values similar to the wp_get_attachment_image_src function.
This will return an array of objects where each object contains information about an image.
If you want to display the images directly as an unordered list, then you can use the shortcode [twp_post_images id=post_id size=some_size].
The parameters of this shortcode are same as those of the above functions.
You will need some CSS knowledge to style the returned unordered list properly.
The functions twp_the_post_images() and twp_get_post_images() return an empty array if no images were found or an array of objects where each object has the following attributes:
id: the attachment id
width: The width of the image
height: The height of the image
orientation: The orientation of the image (landscape|protrait)
url: The url of the image
is_original: (boolean) false if $url is a resized image, true if it is the original.
NOTE THAT YOU HAVE TO SAVE/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Attach Post Images」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Post Thumbs 》Post thumbs 是一個外掛,它能夠通過在文章中搜索圖像,將每篇文章的縮略圖列出來。。
B7 Multiple Featured Images for Post 》### 總結:, B7 Multiple Featured Images for Post 外掛讓 WordPress 使用者可以超越單一特色圖像的限制,在文章中新增最多三張額外的特色圖像,提供更豐富的...。
Modal Post Images 》Modal Posts Images 外掛會為所有 WordPress 文章 entry-content 類別下的圖片增加彈跳視窗的效果。此外掛會呼叫 entry-content 類別下的所有圖片,並添加功...。real.PostImages 》以下是中文翻譯:, 此外掛可讓您為文章附加額外的圖片(在獨立區域中,作為自訂欄位)。, 若要使用函數get_post_images($post_id)取得包含有關文章圖片資訊的...。
Extra Post Images 》此外掛可讓您在 WordPress 安裝上將多張圖片附加到任何文章格式。, 特點, , 透過使用簡碼 [extra-images],可以在文章或頁面中顯示您的圖片,圖片可以以列表...。
Post Attachment Sizes 》這個外掛在 wp-admin 文章編輯畫面提供了一個額外可排序的欄位,讓你可以依附加在文章中所有附件的檔案大小來排序文章。如果你的文章有 10 張圖片附件,顯示...。
