Title: Child Pages Shortcode
Author: Takayuki Miyauchi
Published: <strong>2011 年 10 月 11 日</strong>
Last modified: 2015 年 4 月 26 日

---

搜索插件

![](https://ps.w.org/child-pages-shortcode/assets/banner-772x250.png?rev=526878)

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

![](https://s.w.org/plugins/geopattern-icon/child-pages-shortcode_1b95bb.svg)

# Child Pages Shortcode

 作者：[Takayuki Miyauchi](https://profiles.wordpress.org/miyauchi/)

[下载](https://downloads.wordpress.org/plugin/child-pages-shortcode.1.9.3.zip)

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

 [支持](https://wordpress.org/support/plugin/child-pages-shortcode/)

## 描述

You can use shortcode for display child pages from the page.

[This plugin maintained on GitHub.](https://github.com/miya0001/child-pages-shortcode)

#### Some features

 * This plugin will add shortcode `[child_pages]` display child pages.
 * You can customize default HTML template on your plugin.
 * This plugin will be able to “excerpt” to the pages.

#### Example

Display child pages of the current page.
 [child_pages width=”33%”]

#### Args

 * id – ID of page (Optional)
 * size – Post thumbnail size. e.g. ‘thumbnail’ or ‘large’
 * width – width of block for child pages.
 * disable_shortcode – Shortcode not work in the template if set true.
 * disable_excerpt_filters – filters not work for the excerpt if set true.

#### filter hooks example

Filter for query_posts() query.

    ```
    <?php
        // default args
        $args = array(
            'post_status' => 'publish',
            'post_type' => 'page',
            'post_parent' => $id_for_the_post,
            'orderby' => 'menu_order',
            'order' => 'ASC',
            'nopaging' => true,
        );

        add_filters('child-pages-shortcode-query', "my_query");
        function my_query($args) {
            //
            // some code here
            //
            return $args;
        }
    ?>
    ```

Filter for default template.

    ```
    <?php
        add_filter("child-pages-shortcode-template", "my_template");
        function my_template($template) {
            return '<div class="%class%"><a href="%post_url%">%post_thumb%</a></div>';
        }
    ?>
    ```

Filter for stylesheet URI.

    ```
    <?php
        add_filter("child-pages-shortcode-stylesheet", "my_style");
        function my_style($url) {
            return 'http://example.com/path/to/style.css';
        }
    ?>
    ```

Default Template

    ```
    <div id="child_page-%post_id%" class="child_page" style="width:%width%;">
        <div class="child_page-container">
            <div class="post_thumb"><a href="%post_url%">%post_thumb%</a></div>
            <div class="post_content">
                <h4><a href="%post_url%">%post_title%</a></h4>
                <div class="post_excerpt">%post_excerpt%</div>
            </div>
        </div>
    </div>
    ```

Template valiables

 * %post_id% – ID of the Page
 * %width% – Width of block for single page
 * %post_url% – Page permalink
 * %post_thumb% – for Post thubmail
 * %post_title% – Page title
 * %post_excerpt% – Page excerpt

#### Support

 * http://wpist.me/wp/child-pages-shortcode/ (en)
 * http://firegoby.theta.ne.jp/wp/child-pages-shortcode (ja)

#### Contributors

 * [Takayuki Miyauchi](http://wpist.me/)

### 鸣谢

This plug-in is not guaranteed though the user of WordPress can freely use this 
plug-in free of charge regardless of the purpose.
 The author must acknowledge the
thing that the operation guarantee and the support in this plug-in use are not done
at all beforehand.

### Contact

 * http://wpist.me/
 * [@wpist_me](https://twitter.com/#!/wpist_me)

## 安装

 * A plug-in installation screen is displayed on the WordPress admin panel.
 * It installs it in `wp-content/plugins`.
 * The plug-in is made effective.

## 常见问题

  Installation Instructions

 * A plug-in installation screen is displayed on the WordPress admin panel.
 * It installs it in `wp-content/plugins`.
 * The plug-in is made effective.

## 评价

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

### 󠀁[No longer works](https://wordpress.org/support/topic/no-longer-works-143/)󠁿

 [MoghillPat](https://profiles.wordpress.org/moghillpat/) 2021 年 10 月 5 日

Just for anyone else encountering problems, this plugin outputs php errors in php
7.4 and above

 [ 阅读所有20条评价 ](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/)

## 贡献者及开发者

「Child Pages Shortcode」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Takayuki Miyauchi ](https://profiles.wordpress.org/miyauchi/)

「Child Pages Shortcode」插件已被翻译至 5 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/child-pages-shortcode/contributors)
为本插件所做的贡献。

[帮助将「Child Pages Shortcode」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/child-pages-shortcode)

### 对开发感兴趣吗?

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

## 更新日志

#### 1.9.3

 * Tested on WordPress 4.2.

#### 1.9.2

 * Tested on WordPress 4.1.

#### 1.9.1

 * bug fix – js not found

#### 1.9.0

 * bug fix – css syntax error

#### 1.7.0

 * bug fix – missing wp_reset_postdata()

#### 1.6.0

 * bug fix

#### 1.3.0

 * setup_postdata() added.

#### 1.2.0

 * bug fix

#### 1.1.4

 * bug fix on non-responsive theme

#### 1.1.3

 * Bug fix

#### 1.1.2

 * Bug fix

#### 1.0.1

 * Add filter hook “child-pages-shortcode-output”

#### 0.9.0

 * Add filter hook “child-pages-shortcode-query”
 * Load stylesheet by wp_enqueue_style()

#### 0.8.0

 * Add style “max-width:100%”.

#### 0.4.0

 * add `add_post_type_support("page", "excerpt");`

#### 0.3.0

 * Adapt to no-image.

#### 0.1.0

 * The first release.

## 额外信息

 *  版本 **1.9.3**
 *  最后更新：**9 年前**
 *  活跃安装数量 **5,000+**
 *  WordPress 版本 ** 3.8 或更高版本 **
 *  已测试的最高版本为 **4.2.39**
 *  语言
 * [Chinese (China)](https://cn.wordpress.org/plugins/child-pages-shortcode/) 、
   [English (US)](https://wordpress.org/plugins/child-pages-shortcode/) 、 [French (France)](https://fr.wordpress.org/plugins/child-pages-shortcode/)、
   [Japanese](https://ja.wordpress.org/plugins/child-pages-shortcode/) 、 [Portuguese (Brazil)](https://br.wordpress.org/plugins/child-pages-shortcode/)
   和 [Swedish](https://sv.wordpress.org/plugins/child-pages-shortcode/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/child-pages-shortcode)
 * 标签
 * [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/child-pages-shortcode/advanced/)

## 评级

 4.6 星（最高 5 星）。

 *  [  17 条 5 星评价     ](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/?filter=2)
 *  [  2 条 1 星评价     ](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/child-pages-shortcode/reviews/)

## 贡献者

 *   [ Takayuki Miyauchi ](https://profiles.wordpress.org/miyauchi/)

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/child-pages-shortcode/)