[WordPress] 外掛分享: B7 Multiple Featured Images for Post

首頁外掛目錄 › B7 Multiple Featured Images for Post
WordPress 外掛 B7 Multiple Featured Images for Post 的封面圖片
70+
安裝啟用
尚無評分
378 天前
最後更新
問題解決
WordPress 5.9+ PHP 7.2+ v1.0.0 上架:2025-03-27

內容簡介

### 總結:
B7 Multiple Featured Images for Post 外掛讓 WordPress 使用者可以超越單一特色圖像的限制,在文章中新增最多三張額外的特色圖像,提供更豐富的視覺呈現。透過主題中的簡單功能呼叫或簡便的 shortcode,輕鬆展示這些圖像。

### 問題與答案:
1. 外掛如何協助使用者超越單一特色圖像的限制?
- 答: 外掛讓使用者可以在文章中新增最多三張額外的特色圖像,提供更豐富的視覺呈現。

2. 外掛是如何工作的?
- 答: 外掛透過在 WordPress 文章編輯畫面中添加一個元素框,讓使用者可以使用標準的 WordPress 媒體上傳器選擇最多三張額外的圖像。這些圖像會被儲存為文章的元數據,並可以在網站前端檢索和顯示。

3. 如何新增多個特色圖像?
- 答: 編輯文章時,在側邊欄找到 "Multiple Featured Images" 元素框,點擊 "Select Image" 按鈕,使用 WordPress 媒體庫選擇最多三張額外的特色圖像,然後保存或更新文章。

4. 如何在前端顯示圖像?
- 答: 在主題的模板檔案中,使用函數 `b7mufeimdisplaymultiplefeatured_images( get_the_ID(), 'medium' );`,替換 'medium' 為所需的圖像大小 (縮圖、中型、大型、完整等)。

5. 如何使用 shortcode 顯示多個特色圖像?
- 答: 在文章內容或小工具中使用 shortcode `[b7_multiple_featured_images]` 顯示多個特色圖像。可以透過參數自訂輸出,如指定圖像大小或文章 ID。

6. 舉例說明 shortcode 的用法?
- 答:
- 基本用法 (縮圖大小,當前文章): `[b7_multiple_featured_images]`
- 指定圖像大小 (中型,當前文章): `[b7_multiple_featured_images size="medium"]`
- 指定文章 ID (縮圖大小,指定文章): `[b7_multiple_featured_images post_id="123"]`
- 同時指定大小和文章 ID (大型,指定文章): `[b7_multiple_featured_images size="large" post_id="456"]`

7. 如何在小工具中使用 shortcode 顯示多個特色圖像?
- 答: 可直接將任何上面的 shortcode 範例貼入 WordPress 文字小工具中,以在側邊欄或其他小工具區域中顯示多個特色圖像。在大多數情況下,建議指定文章 ID 以從特定文章顯示圖像,而不是依賴"當前文章"。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「B7 Multiple Featured Images for Post」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The “B7 Multiple Featured Images for Post” plugin for WordPress allows you to go beyond the single featured image limitation. This plugin empowers you to add up to three additional featured images to your posts, providing a richer visual representation of your content. Display these images on your posts using a simple function call in your theme or via a convenient shortcode.
How does the plugin work?
This plugin extends the functionality of WordPress posts by adding a meta box in the post edit screen. This meta box allows you to select up to three additional images using the standard WordPress media uploader. These images are then stored as post meta data, which can be retrieved and displayed on the front-end of your site.
Usage

Adding Multiple Featured Images: When editing a post, locate the “Multiple Featured Images” meta box in the sidebar.
Click the “Select Image” buttons to choose up to three additional featured images using the WordPress Media Library.
Save or update your post.

Displaying Images on the Frontend:

In your theme’s template files: Use the function b7mufeimdisplaymultiplefeatured_images( get_the_ID(), 'medium' ); in your theme’s template files (e.g., single.php, content.php). Replace 'medium' with your desired image size (thumbnail, medium, large, full, or custom sizes).

Using Shortcode: Use the shortcode [b7_multiple_featured_images] within your post content or widgets to display the multiple featured images.
Shortcode Parameters:
The [b7_multiple_featured_images] shortcode accepts the following optional parameters to customize its output:

size: (Optional) Defines the image size to be displayed.

Possible values: Any registered WordPress image size name (e.g., thumbnail, medium, large, full) or a custom image size name defined by your theme.
Default value: thumbnail if the size parameter is not specified.

post_id: (Optional) Specifies which post’s featured images to display.

Possible values: The ID of a WordPress post.
Default value: If post_id is not specified, the shortcode will display multiple featured images for the current post where the shortcode is used.

Shortcode Usage Examples:
Here are various ways to use the shortcode:

Basic Usage (Default Thumbnail Size, Current Post):
[b7_multiple_featured_images]
This will display the multiple featured images of the current post, using the thumbnail image size for each image.

Specify Image Size (Medium Size, Current Post):
[b7_multiple_featured_images size="medium"]
This will display the multiple featured images of the current post, using the medium image size. You can replace "medium" with other sizes like "large" or "full".

Specify a Post ID (Thumbnail Size, Specific Post):
[b7_multiple_featured_images post_id="123"]
This will display the multiple featured images of the post with ID 123, using the default thumbnail image size. Replace "123" with the actual ID of the post you want to target.

Specify Both Size and Post ID (Large Size, Specific Post):
[b7_multiple_featured_images size="large" post_id="456"]
This will display the multiple featured images of the post with ID 456, using the large image size. Replace "456" with the desired post ID and "large" with your preferred image size.

Using in Widgets: You can directly paste any of the above shortcode examples into a WordPress Text widget to display multiple featured images in your sidebar or other widget areas. Remember that in most cases in widget areas, you would likely want to specify a post_id to display images from a specific post, rather than relying on “current post”.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon