Title: Section Subnav
Author: benknight
Published: <strong>2011年8月30日</strong>
Last modified: 2011年8月30日

---

搜尋外掛

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

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

# Section Subnav

 由[benknight](https://profiles.wordpress.org/benknight/)

[下載](https://downloads.wordpress.org/plugin/section-subnav.0.9.zip)

 * [詳情](https://zh-hk.wordpress.org/plugins/section-subnav/#description)
 * [評價](https://zh-hk.wordpress.org/plugins/section-subnav/#reviews)
 *  [安裝](https://zh-hk.wordpress.org/plugins/section-subnav/#installation)
 * [開發](https://zh-hk.wordpress.org/plugins/section-subnav/#developers)

 [支援](https://wordpress.org/support/plugin/section-subnav/)

## 描述

This is a simple plugin that was born out of working on several projects with sectional
navigations. For example, consider the following common navigation tree structure:

 * Home
 * Item
 * About Us
    - Sub-item #1
    - Sub-item #2
 * Item
 * Item

Then, whenever on the “About Us” page or any of its sub-items, it would output that
peice of the navigation:

 * About Us
    - Sub-item #1
    - Sub-item #2

This is particularly useful for websites that have a top horizontal navigation which
shows top-level items and want to show a vertical subnavigation in the sidebar.

This plugin works by parsing the output of the `wp_nav_menu` function as XML and
analyzing the CSS class hooks (current-menu-ancestor, current-menu-item, and current-
menu-parent). Because it uses PHP’s SimpleXML library it therefore requires PHP 
5+. It uses the theme’s registered menu locations.

This plugin also exposes the `section_subnav()` function for theme developers to
use as a template tag to manually place a subnav inside the theme. Here is the usage:

    ```
    <?php

        section_subnav( array( // defaults
            'before_widget' => '<nav id="section-subnav" class="widget widget_section-subnav">',
            'after_widget' => "</nav>",
            'before_title' => '<h3 class="section-subnav-title widget-title">',
            'after_title' => '</h3>',
            'echo' => true
        ));

    ?>
    ```

It returns false when there is no subnavigation.

This function also provides the `section_subnav_args` filter hook for writing less
code and easier integration with other plugins and child themes.

## 安裝

This section describes how to install the plugin and get it working.

 1. Upload `section-subnav` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Add the widget to a sidebar or use the `section_subnav()` function in one of your
    theme templates.

## 評價

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

### 󠀁[Excellent Plugin](https://wordpress.org/support/topic/excellent-plugin-3523/)󠁿

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

There is nothing else like it among wordpress.org plugins. You should update it 
to keep it current.

 [ 閱讀全部3個評價 ](https://wordpress.org/support/plugin/section-subnav/reviews/)

## 貢獻者及開發者

“Section Subnav” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

 *   [ benknight ](https://profiles.wordpress.org/benknight/)

[將 Section Subnav 外掛本地化為台灣繁體中文版。](https://translate.wordpress.org/projects/wp-plugins/section-subnav)

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

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

## 修改日誌

#### 0.9

 * Initial release.

## 其它

 *  Version **0.9**
 *  Last updated **15 年之前**
 *  Active installations **60+**
 *  WordPress version ** 3.1 or higher **
 *  Tested up to **3.2.1**
 *  Language
 * [English (US)](https://wordpress.org/plugins/section-subnav/)
 * Tags
 * [menu](https://zh-hk.wordpress.org/plugins/tags/menu/)[navigation](https://zh-hk.wordpress.org/plugins/tags/navigation/)
   [widget](https://zh-hk.wordpress.org/plugins/tags/widget/)
 *  [進階顯示](https://zh-hk.wordpress.org/plugins/section-subnav/advanced/)

## 評分

 5 out of 5 stars.

 *  [  3 5-star reviews     ](https://wordpress.org/support/plugin/section-subnav/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/section-subnav/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/section-subnav/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/section-subnav/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/section-subnav/reviews/?filter=1)

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

[See all reviews](https://wordpress.org/support/plugin/section-subnav/reviews/)

## 貢獻者

 *   [ benknight ](https://profiles.wordpress.org/benknight/)

## 支援

有話想說？需要協助？

 [檢視支援論壇](https://wordpress.org/support/plugin/section-subnav/)

## 捐贈

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

 [ 贊助這個外掛 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=NYCGJ7YCGUTAQ&lc=US&item_name=Benjamin%20Knight&item_number=section%2dsubnav&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)