Title: Subpage Listing
Author: Mark Jaquith
Published: <strong>2005 年 7 月 29 日</strong>
Last modified: 2012 年 5 月 16 日

---

搜索插件

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

![](https://s.w.org/plugins/geopattern-icon/subpage-listing.svg)

# Subpage Listing

 作者：[Mark Jaquith](https://profiles.wordpress.org/markjaquith/)

[下载](https://downloads.wordpress.org/plugin/subpage-listing.0.6.2.zip)

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

 [支持](https://wordpress.org/support/plugin/subpage-listing/)

## 描述

Subpage Listing allows you to take full advantage of WordPress Pages’ hierarchy 
by generating a navigational tree of the pages below them (subpages).

For example, say you have a parent page called “Parent.” Now, say you have 3 pages
under “Parent,” called “Child1,” “Child2,” and “Child3.” Now, say that you have 
2 pages under “Child2” called “Grandchild1” and “Grandchild2.”

Subpage Listing would create a navigation tree for “Parent” that looks like this:

 * Child1
 * Child2
    - Grandchild1
    - Grandchild2
 * Child3

This allows you to very easily create a complex hierarchical structure that can 
be browsed.

### Advanced Usage

Blank pages will automatically be given a navigation tree. This allows you to quickly
create “container” pages (all you do is fill in a title, and choose the page’s parent.)

If you would like to insert the navigational tree manually (that is, surrounded 
by text of your choosing), use the “Subpage Listing” quicktag that will show up 
on the Write Page screen (sorry, no RTE support at this time). This will insert 
the tag:  which will be replaced by the listing of the subpages.

Note: when inserting the tag manually, make sure that there is a blank line both
above and below the tag, so as to ensure proper handling of your surrounding paragraphs
by WordPress.

Version 0.6 was a massive update that added a bunch of new functionality. The ability
to show the current page’s parent has been added, as well as the ability to show
the current page’s siblings. You can also suppress the showing of children, and 
show only siblings, parents, or both. To use these features within a post, use this
syntax:  The first “parameter” is the depth you want to show. You can set this to
0 to suppress display of children. The second “parameter” is a boolean switch for
display of the parent page. The third “parameter” is a boolean switch for display
of sibling pages. All are optional, although if you want to set the second “parameter”,
you also have to set the first, and if you want to set the third, you have to set
all three.

There is also a new function for use in your templates. Many people wanted to show
subpages or siblings in their sidebar, so now you can do that. `<?php txfx_wp_subpages();?
>` is the most basic form, but it can take many parameters.

    ```
    <?php txfx_wp_subpages(5, false, false, '<ul>', '</ul>', true); ?> will show 5 pages deep (first parameter), hide the parent (second parameter), hide the siblings (third parameter), wrap the whole thing in '<ul>' and '</ul>' (fourth and fifth parameters), and will echo the result (sixth parameter). These happen to be the default settings, that I have just illustrated.
    ```

## 安装

 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place `<!--%subpages%-->` in an page’s content and it will be replaced with a hierarchical
    list of subpages
 4. See “Advanced Usage” for more detail

## 评价

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

### 󠀁[PHP8 Change](https://wordpress.org/support/topic/php8-change/)󠁿

 [](https://profiles.wordpress.org/etfb/) 2022 年 7 月 27 日

This hasn’t been updated in years, so obviously it would be better to find a supported
plugin to do the same thing, but if you just want to get it working in PHP8, go 
in to subpage-listing.php and change the last couple of lines to: // doing it this
way for compatibility with the Preformatted plugin add_filter(‘init’, function($
a) { add_filter(‘the_content’, ‘txfx_wp_subpage_display’, 9); }); That should fix
it. create_function isn’t supported in PHP8 (nor should it be… *shudder*)

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

### 󠀁[Requires plugin update version](https://wordpress.org/support/topic/requires-plugin-update-version/)󠁿

 [koushik1987](https://profiles.wordpress.org/koushik1987/) 2022 年 6 月 23 日

Require an updated version of this plugin that supports PHP 8 version.

 [ 阅读所有4条评价 ](https://wordpress.org/support/plugin/subpage-listing/reviews/)

## 贡献者及开发者

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

贡献者

 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)

[帮助将「Subpage Listing」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/subpage-listing)

### 对开发感兴趣吗?

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

## 额外信息

 *  版本 **0.6.2**
 *  最后更新：**14 年前**
 *  活跃安装数量 **200+**
 *  WordPress 版本 ** 2.0 或更高版本 **
 *  已测试的最高版本为 **2.1.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/subpage-listing/)
 * 标签
 * [hierarchy](https://cn.wordpress.org/plugins/tags/hierarchy/)[pages](https://cn.wordpress.org/plugins/tags/pages/)
   [subpages](https://cn.wordpress.org/plugins/tags/subpages/)[tree](https://cn.wordpress.org/plugins/tags/tree/)
 *  [高级视图](https://cn.wordpress.org/plugins/subpage-listing/advanced/)

## 评级

 3.8 星（最高 5 星）。

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

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

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

## 贡献者

 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/subpage-listing/)

## 捐助

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

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mark%2epaypal%40txfx%2enet&item_name=Mark%20Jaquith%20Coding&no_shipping=0&no_note=1&tax=0&currency_code=USD&charset=UTF%2d8&charset=UTF%2d8)