Title: Featured Galleries
Author: Andy Mercer
Published: <strong>2014 年 2 月 27 日</strong>
Last modified: 2018 年 8 月 2 日

---

搜尋外掛

![](https://ps.w.org/featured-galleries/assets/banner-772x250.png?rev=865937)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/featured-galleries/assets/icon-256x256.png?rev=1073825)

# Featured Galleries

 由 [Andy Mercer](https://profiles.wordpress.org/kelderic/) 開發

[下載](https://downloads.wordpress.org/plugin/featured-galleries.2.1.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/featured-galleries/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/featured-galleries/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/featured-galleries/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/featured-galleries/#developers)

 [技術支援](https://wordpress.org/support/plugin/featured-galleries/)

## 外掛說明

#### Hello Theme Developers!

Have you ever added a Featured Image to a post and thought to yourself, “I wish 
I could add more than one image this way”? Well, now you can. Featured Galleries
mirrors the Featured Images functionality of WordPress. The only difference is that
posts get an entire gallery rather than just a single image. These galleries behave
almost exactly like Featured Images, and make use of WordPress’s built in Media 
Manager. Users can select images, define the order, and save the gallery, all through
a simple drag-n-drop interface.

**Note**: This plugin DOES NOT HANDLE THE FRONTEND HTML CREATION. That is left for
themes to handle, to allow for maximum flexibility. Featured Galleries just handles
the backend/admin interface for creating featured galleries and storing them as 
metadata. You will need to integrate this into your theme, or use a theme with prebuilt
integration.

#### Quick Start Guide to Integrate Into Themes

_For more information, see [GitHub Wiki](https://github.com/Kelderic/featured-galleries/wiki)_.

I’ve tried to make this as intuitive as possible. Themes can integrate Featured 
Galleries in the same way they integrate Featured Images. Inside any template file
where the gallery should appear, the theme will call the [`get_post_gallery_ids()`](https://github.com/Kelderic/featured-galleries/wiki/get_post_gallery_ids)
function. As long as it is used inside the loop, the function doesn’t need any parameters.
By default, it will return an array of image IDs.

#### Example

Set inside the Loop. This returns all images in the Featured Gallery, as an array,
then loops through to display each using an HTML `<img>` tag.

    ```
    $galleryArray = get_post_gallery_ids(); 

    foreach ( $galleryArray as $id ) {

        echo '<img src="' . wp_get_attachment_url( $id ) .'">';

    }
    ```

You can also customize the returned value from the function to suit your needs. 
See the full [function documentation](https://github.com/Kelderic/featured-galleries/wiki/get_post_gallery_ids)
page for details.

#### Custom Post Types

The plugin comes with a filter to easily add Featured Galleries to custom post types.
See the [`fg_post_types`](https://github.com/Kelderic/featured-galleries/wiki/fg_post_types)
documentation page for details.

#### Customizing the Media Manager

The media manager can be customized in sevearl ways. See the [`fg_show_sidebar`](https://github.com/Kelderic/featured-galleries/wiki/fg_show_sid℮bar)
and [`fg_use_legacy_selection`](https://github.com/Kelderic/featured-galleries/wiki/fg_use_legacy_selection)
filter documentation pages for details.

#### Want to Help?

I’d love some help with internationalization. It was working at one point, but drivingralle
did that code because I don’t really understand it, and I’m not sure it’s still 
working.

## 螢幕擷圖

[⌊Initial metabox, no images in the gallery.⌉⌊Initial metabox, no images in the 
gallery.⌉[

Initial metabox, no images in the gallery.

[⌊Metabox with images selected and added.⌉⌊Metabox with images selected and added
.⌉[

Metabox with images selected and added.

## 安裝方式

There are two ways to install this plugin.

Manual:

 1. Upload the `featured-galleries` folder to the `/wp-content/plugins/` directory
 2. Go to the ‘Plugins’ menu in WordPress, find ‘Featured Galleries’ in the list, and
    select ‘Activate’.

Through the WP Repository:

 1. Go to the ‘Plugins’ menu in WordPress, click on the ‘Add New’ button.
 2. Search for ‘Featured Galleries’. Click ‘Install Now’.
 3. Return to the ‘Plugins’ menu in WordPress, find ‘Featured Galleries’ in the list,
    and select ‘Activate’.

## 常見問題集

  Installation Instructions

There are two ways to install this plugin.

Manual:

 1. Upload the `featured-galleries` folder to the `/wp-content/plugins/` directory
 2. Go to the ‘Plugins’ menu in WordPress, find ‘Featured Galleries’ in the list, and
    select ‘Activate’.

Through the WP Repository:

 1. Go to the ‘Plugins’ menu in WordPress, click on the ‘Add New’ button.
 2. Search for ‘Featured Galleries’. Click ‘Install Now’.
 3. Return to the ‘Plugins’ menu in WordPress, find ‘Featured Galleries’ in the list,
    and select ‘Activate’.

  What is the point of this?

I was tasked to update a Featured Projects page for a client website. Projects were
a custom post type, and the page displaying them used a special WP_Query. Each Project
had a featured image. The client wanted each to have several images that could be
clicked through with arrows. I couldn’t find an easy way to accomplish this, so 
I built it from scratch. A friend suggested I abstract it into a plugin to share.

  Will it be improved?

Yes. The next step on my roadmap is to figure out how to do a one time re-keying
of all data to start with an underscore, so that it’s invisible.

  Can I add a featured gallery to my custom post type?

Why yes you can! You don’t even have to edit the plugin to do so. There are details
on how to do this in the Instructions.

## 使用者評論

![](https://secure.gravatar.com/avatar/2f2f497601efadb1fc7bf8338b97565d1fcad89740122b65e7141ed39e8d18c2?
s=60&d=retro&r=g)

### 󠀁[Well done](https://wordpress.org/support/topic/well-done-653/)󠁿

 [kirat14](https://profiles.wordpress.org/kirat14/) 2021 年 5 月 25 日

Thanks for sharing this plugin.

![](https://secure.gravatar.com/avatar/87bba652a1c78200da2d6ca1fb9f3ea307427589d0dd0461bb23074115bc23ac?
s=60&d=retro&r=g)

### 󠀁[Awesome!](https://wordpress.org/support/topic/awesome-6447/)󠁿

 [Carlos Kaval](https://profiles.wordpress.org/carloskaval/) 2019 年 2 月 20 日

Awesome!

![](https://secure.gravatar.com/avatar/2b2c34efdba1ce044d4f361d1ae13351d79519d700b325337cc1b9b4e0c971bf?
s=60&d=retro&r=g)

### 󠀁[Spot on](https://wordpress.org/support/topic/spot-on-69/)󠁿

 [i4nd90](https://profiles.wordpress.org/i4nd90/) 2019 年 2 月 6 日

So glad I’ve discovered this, there are so many bad sliders out there I was driven
to make my own too. This plugin does all the heavy lifting for me.

![](https://secure.gravatar.com/avatar/f121de526e3b4751b98b5a98da7e358057b251e55da3e0b09d3527ef2158b5d4?
s=60&d=retro&r=g)

### 󠀁[Not working with 4.9.6](https://wordpress.org/support/topic/not-working-with-4-9-6/)󠁿

 [chrisvwlc](https://profiles.wordpress.org/chrisvwlc/) 2018 年 6 月 21 日 3 則留言

Cannot select multiple images upon clicking create featured gallery button – can
only choose one.

![](https://secure.gravatar.com/avatar/adc8e1168eb3a3325b0b3a770156307a6c73a7857408a7083292dacf941d2b30?
s=60&d=retro&r=g)

### 󠀁[superv](https://wordpress.org/support/topic/superv-2/)󠁿

 [monoentrenado](https://profiles.wordpress.org/monoentrenado/) 2017 年 12 月 13
日

Works as described, pre-built cpt support

![](https://secure.gravatar.com/avatar/6b4b8b044bdec1cd45c10c383054263da330f075c5854e7fe4136f9576787ada?
s=60&d=retro&r=g)

### 󠀁[Great Plugin!](https://wordpress.org/support/topic/great-plugin-14426/)󠁿

 [hydrozowa](https://profiles.wordpress.org/hydrozowa/) 2017 年 7 月 11 日

Thanks… Saved time 🙂

 [ 閱讀全部 20 則使用者評論 ](https://wordpress.org/support/plugin/featured-galleries/reviews/)

## 參與者及開發者

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

參與者

 *   [ Andy Mercer ](https://profiles.wordpress.org/kelderic/)
 *   [ Drivingralle ](https://profiles.wordpress.org/drivingralle/)

〈Featured Galleries〉外掛目前已有 8 個本地化語言版本。 感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/featured-galleries/contributors)
為這個外掛做出的貢獻。

[將〈Featured Galleries〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/featured-galleries)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/featured-galleries/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/featured-galleries/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/featured-galleries/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/featured-galleries/)。

## 變更記錄

#### 2.1.0

 * Enhancement: Switched multi-select type from Library to Gallery. You no longer
   have to hold the SHIFT or CONTROL/COMMAND keys to select multiple items. To restore
   the old behavior, use the new `fg_use_legacy_selection` filter. See docs for 
   details.
 * Bugfix: Fix broken details sidebar hiding filter. The details sidebar is now 
   properly hidden again by default, and can be shown be using the `fg_show_sidebar`
   filter.
 * Under the Hood: Complete rewrite of all CSS styles. FG styles are now isolated
   and don’t affect other media manager modals.

#### 2.0.1

 * Bugfix: Don’t run plugin logic on old versions of PHP that are incompatible.

#### 2.0.0

 * Under the Hood: Complete rewrite top to bottom of all PHP and Javascript.
 * Enhancement: Improved admin preview styles to show more thumbnails in less space.
 * Enhancement: Added documentation for public API function into Readme.
 * Enhancement: Improved Readme examples.
 * Enhancement: Added No-JS fallback.
 * Enhancement: Add compatibility with the picu plugin.
 * Bugfix: Primary buttons in Media Manager now have proper labels again.
 * Change: Bumped WordPress Version Requirement to 3.8.
 * Change: Bumped PHP Version Requirement to 5.4.

#### 1.7.1

 * Added missing stylesheet to hide sidebar.

#### 1.7.0

 * Added filter to allow themes to show the sidebar in the media manager instance
   created by Featured Galleries (Sidebar is hidden by default).

#### 1.6.0

 * Improved CSS styling of the backend gallery inside the metabox. Metabox is now
   more responsive, per request.

#### 1.5.0

 * Accidentally put the version of 1.4.5 when I meant to use 1.4.4, but in change
   log used correct version. This bump to 1.5 restores consistency.

#### 1.4.4

 * Tested with WP 4.4 and bumped up compatibility.

#### 1.4.3

 * Bugfix: If `get_post_gallery_ids()` was called on post with empty Featured Gallery,
   using an array return (the default), an array containing one string (a comma)
   was returned instead of an empty array.

#### 1.4.2

 * Bugfix: Undefined variable `$oldfix` when running post-MP6 versions of WordPress(
   3.9 and over). Props Joshuadnelson.
 * WordPress 4.2 compatibility bump.

#### 1.4.1

 * Updating readme to add example code for custom post types.

#### 1.4.0

 * WordPress 4.1 compatibility bump.
 * Bugfix: Margin difference between buttons on left and right in media model.
 * Bugfix: Button type and text change didn’t fire when Media model defaults to 
   upload instead of to media library.

#### 1.3.1

 * Fixed issue where the scripts required to open the Media Manager might notbe 
   enqueued.

#### 1.3.0

 * Added internationalization and German translation. Props to Drivingralle.
 * Formatting fixes to better match WordPress PHP best practices. Props Drivingralle.

#### 1.2.4

 * Fixes a typo in the readme.txt file.

#### 1.2.3

 * As reported in suppor thread, error messages were being thrown in WP DEBUG mode,
   when trying to save things unrelated to plugin. Fixes those errors.

#### 1.2.2

 * More bug fixes for 3.9 and 3.5 – 3.7, to bring everything into line visually 
   in all versions that use the media manager.

#### 1.2.1

 * Bugfix, CSS background positioning missing on delete images icons in WP 3.5 –
   3.7.

#### 1.2.0

 * Added compatibility for WordPress 3.9 (Had to rearrange the javascript slightly).
 * Improved compatibility for WordPress 3.5 – 3.7 by using built in icon images 
   instead of Dashicons in those versions.

#### 1.1.6

 * Fixed inconsistent Markup.

#### 1.1.5

 * Overhauled readme.txt to include implementation instructions and examples.

#### 1.1.4

 * Slight bug was introduced in 1.1.3, **get_post_gallery_ids()** won’t work.

#### 1.1.3

 * Added a new argument to **get_post_gallery_ids()**, allowing it to return only
   the first image in the gallery.

#### 1.1.2

 * Minor bug fix update. If used opened, closed, and then reopened the gallery selector,
   the back button would appear incorrectly. Skipping 1.1.1 because that is a silly
   version number.

#### 1.1.0

 * Completely screwed up commits for 1.0.0 and 1.0.1, and copied the entire folder
   instead of trunk. Fixed now.

#### 1.0.1

 * Minor update, fixed a CSS bug where buttons were incorrectly small on mobile (
   < 783px) screens.

#### 1.0.0

 * First public version. Added support for WP’s Preview Changes functionality. Accomplished
   this be using two pieces of metadata.

#### 0.9.0

 * Initial test version sent to WP for submission.

## 中繼資料

 *  版本 **2.1.0**
 *  最後更新 **8 年前**
 *  啟用安裝數 **3,000+**
 *  WordPress 版本需求 ** 3.8.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.9.29**
 *  PHP 版本需求 ** 5.4 或更新版本 **
 *  語言
 * [English (Canada)](https://en-ca.wordpress.org/plugins/featured-galleries/)、
   [English (US)](https://wordpress.org/plugins/featured-galleries/)、[German](https://de.wordpress.org/plugins/featured-galleries/)、
   [Romanian](https://ro.wordpress.org/plugins/featured-galleries/)、[Spanish (Chile)](https://cl.wordpress.org/plugins/featured-galleries/)、
   [Spanish (Colombia)](https://es-co.wordpress.org/plugins/featured-galleries/)、
   [Spanish (Mexico)](https://es-mx.wordpress.org/plugins/featured-galleries/)、
   [Spanish (Spain)](https://es.wordpress.org/plugins/featured-galleries/)、及 [Spanish (Venezuela)](https://ve.wordpress.org/plugins/featured-galleries/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/featured-galleries)
 * 標籤:
 * [admin](https://tw.wordpress.org/plugins/tags/admin/)[backend](https://tw.wordpress.org/plugins/tags/backend/)
   [featured](https://tw.wordpress.org/plugins/tags/featured/)[galleries](https://tw.wordpress.org/plugins/tags/galleries/)
   [images](https://tw.wordpress.org/plugins/tags/images/)
 *  [進階檢視](https://tw.wordpress.org/plugins/featured-galleries/advanced/)

## 評分

 4.7 星，滿分為 5 星

 *  [  17 個 5 星使用者評論     ](https://wordpress.org/support/plugin/featured-galleries/reviews/?filter=5)
 *  [  2 個 4 星使用者評論     ](https://wordpress.org/support/plugin/featured-galleries/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/featured-galleries/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/featured-galleries/reviews/?filter=2)
 *  [  1 個 1 星使用者評論     ](https://wordpress.org/support/plugin/featured-galleries/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/featured-galleries/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/featured-galleries/reviews/)

## 參與者

 *   [ Andy Mercer ](https://profiles.wordpress.org/kelderic/)
 *   [ Drivingralle ](https://profiles.wordpress.org/drivingralle/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/featured-galleries/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](http://www.andymercer.net)