Title: Post Format Gallery Widget
Author: Eduardo Zulian
Published: <strong>2013 年 10 月 10 日</strong>
Last modified: 2013 年 10 月 23 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/post-format-gallery-widget.svg)

# Post Format Gallery Widget

 作者：[Eduardo Zulian](https://profiles.wordpress.org/eduardozulian/)

[下载](https://downloads.wordpress.org/plugin/post-format-gallery-widget.1.1.zip)

 * [详情](https://cn.wordpress.org/plugins/post-format-gallery-widget/#description)
 * [评价](https://cn.wordpress.org/plugins/post-format-gallery-widget/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/post-format-gallery-widget/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/post-format-gallery-widget/#developers)

 [支持](https://wordpress.org/support/plugin/post-format-gallery-widget/)

## 描述

The Post Format Gallery Widget plugin creates the possibility for you to display
images from your galleries inside posts saved under the format ‘Gallery’. You can
select the number of images to display, the size of these images, shuffle their 
orders, the target of links (image file, permalink to attachment, permalink to post
or maybe no linking), show captions and use one copy of the basic WordPress style
for galleries, which will allow you to set up easily a number of columns.

**Important**: your theme must support the [Gallery post format](https://codex.wordpress.org/Post_Formats#Adding_Theme_Support),
otherwise it won’t work.

## 安装

 1. Upload `post-format-gallery-widget` directory to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Go to ‘Widgets’ menu and drag it to your sidebar

## 常见问题

  The widget only shows this message: “Your theme does not support the Gallery post
format. Please add this support so you can choose your posts.”

Yes, that’s it. You have to [enable support for the gallery post format](https://codex.wordpress.org/Post_Formats#Adding_Theme_Support)
on your theme. This plugin will only search for galleries inside a post saved under
the post format Gallery.

  Can I add / remove / change gallery classes?

Yes. Just use the `pfgw_gallery_classes` filter in your `functions.php` file:

    ```
    /**
     * Add a new class to the gallery container
     *
     * @param array $classes 
     */
    function mytheme_change_pfgw_classes( $classes ) {
        $classes[] = 'my-class';
        return $classes;
    }
    add_filter( 'pfgw_gallery_classes', 'mytheme_change_pfgw_classes' );
    ```

  Does it only work with posts? What about other post types?

The default type is `post`. However, you can use `pfgw_post_types` filter in your`
functions.php` file and then add or remove how many post types you wish. Just remember
that [your theme must support](https://codex.wordpress.org/Post_Formats#Adding_Post_Type_Support)
these post types as well.

    ```
    /**
     * Add another post type to our gallery query
     *
     * @param array $post_types The post types for the query 
     */
    function mytheme_add_post_types( $post_types ) {
        $post_types[] = 'page';
        return $post_types;
    }
    add_filter( 'pfgw_post_types', 'mytheme_add_post_types' );
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

「Post Format Gallery Widget」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Eduardo Zulian ](https://profiles.wordpress.org/eduardozulian/)

[帮助将「Post Format Gallery Widget」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/post-format-gallery-widget)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/post-format-gallery-widget/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/post-format-gallery-widget/)，或
通过[RSS](https://plugins.trac.wordpress.org/log/post-format-gallery-widget/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/post-format-gallery-widget/)。

## 更新日志

#### 1.1

 * Make style unique for our widget using class `.widget_post_format_gallery`

#### 1.0

 * First version.

## 额外信息

 *  版本 **1.1**
 *  最后更新：**13 年前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 3.6 或更高版本 **
 *  已测试的最高版本为 **3.6.1**
 *  语言
 * [English (US)](https://wordpress.org/plugins/post-format-gallery-widget/)
 * 标签
 * [gallery](https://cn.wordpress.org/plugins/tags/gallery/)[post format](https://cn.wordpress.org/plugins/tags/post-format/)
   [sidebar](https://cn.wordpress.org/plugins/tags/sidebar/)[widget](https://cn.wordpress.org/plugins/tags/widget/)
 *  [高级视图](https://cn.wordpress.org/plugins/post-format-gallery-widget/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/post-format-gallery-widget/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/post-format-gallery-widget/reviews/)

## 贡献者

 *   [ Eduardo Zulian ](https://profiles.wordpress.org/eduardozulian/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/post-format-gallery-widget/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H28V8F5PHSZHA)