Title: Extra Classes
Author: Ben Huson
Published: <strong>2013 年 2 月 11 日</strong>
Last modified: 2015 年 4 月 23 日

---

搜索插件

![](https://ps.w.org/extra-classes/assets/banner-772x250.png?rev=1036934)

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

![](https://ps.w.org/extra-classes/assets/icon-256x256.png?rev=1036934)

# Extra Classes

 作者：[Ben Huson](https://profiles.wordpress.org/husobj/)

[下载](https://downloads.wordpress.org/plugin/extra-classes.0.3.1.zip)

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

 [支持](https://wordpress.org/support/plugin/extra-classes/)

## 描述

#### Add missing classes

Adds missing classes for selected menu states. Classes added include:

 * `current-page-parent` and `current_page_parent`
 * `current-page-ancestor` and `current_page_ancestor`
 * `current-menu-ancestor`
 * `current-menu-parent`

The classes are added in the following scenarios:

 * **When viewing an attachment page** classes are added to any parent pages and
   their menu ancestors.
 * **When viewing a post** classes are added to any relevant taxonomy menu items
   and their manu ancestors.

#### Manage Menu Select States

Allows you to control which menu items should be selected (or deselected) when viewing
certain pages of your site. You need to add classes to the menu items for this to
work.

 * `ecms-archive-{$post_type}` – Select menu item when viewing a post type archive
   page.
 * `ecms-single-{$post_type}` – Select menu item when viewing a single post type
   page.
 * `ecms-taxonomy-{$taxonomy}` – Select menu item when viewing a taxonomy archive.
 * `ecms-taxonomy-{$taxonomy}-term-{$term}` – Select menu item when viewing a taxonomy
   term archive.
 * `ecms-404` – Select menu item when viewing a 404 page.
 * `ecms-no-archive-{$post_type}` – Deselect menu item when viewing a post type 
   archive page.
 * `ecms-no-single-{$post_type}` – Deselect menu item when viewing a single post
   type page.
 * `ecms-no-taxonomy-{$taxonomy}` – Deselect menu item when viewing a taxonomy archive.
 * `ecms-no-taxonomy-{$taxonomy}-term-{$term}` – Deselect menu item when viewing
   a taxonomy term archive.
 * `ecms-no-404` – Deselect menu item when viewing a 404 page.

## 安装

To install and configure this plugin…

 1. Upload or install the plugin through your WordPress admin.
 2. Activate the plugin via the ‘Plugins’ admin menu.
 3. No configuration neccessary.

#### Upgrading

If you are upgrading manually via FTP rather that through the WordPress automatic
upgrade link, please de-activate and re-activate the plugin to ensure the plugin
upgrades correctly.

## 常见问题

  Where can I report bugs and issues?

Please log issues and bugs on the plugin’s [GitHub page](https://github.com/benhuson/extra-classes/issues).

You can also submit suggested enhancements if you like.

  How can I contribute?

If you can, please [fork the code](https://github.com/benhuson/extra-classes) and
submit a pull request via GitHub. If you’re not comfortable using Git, then please
just submit it to the issues link above.

## 评价

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

### 󠀁[Simple and effective](https://wordpress.org/support/topic/simple-and-effective-654/)󠁿

 [Mary](https://profiles.wordpress.org/marypop/) 2016 年 10 月 7 日

Love this plugin. Thanks :))

 [ 阅读所有3条评价 ](https://wordpress.org/support/plugin/extra-classes/reviews/)

## 贡献者及开发者

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

贡献者

 *   [ Ben Huson ](https://profiles.wordpress.org/husobj/)

[帮助将「Extra Classes」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/extra-classes)

### 对开发感兴趣吗?

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

## 更新日志

#### 0.3.1

Fix issue where menu selected states were not inherited correctly for non-404 pages.

#### 0.3

Added Menu Selector support for ‘ecms-404’ and ‘ecms-no-404’ classes.

#### 0.2

Added Menu Selector class.
 Add menus module and ‘extraclasses_menu_item_class’ 
filter for easier filtering of menu item classes. Restructure include files for 
modules.

#### 0.1

First release (beta).

## 额外信息

 *  版本 **0.3.1**
 *  最后更新：**11 年前**
 *  活跃安装数量 **30+**
 *  WordPress 版本 ** 3.7 或更高版本 **
 *  已测试的最高版本为 **4.2.39**
 *  语言
 * [English (US)](https://wordpress.org/plugins/extra-classes/)
 * 标签
 * [class](https://cn.wordpress.org/plugins/tags/class/)[classes](https://cn.wordpress.org/plugins/tags/classes/)
   [css](https://cn.wordpress.org/plugins/tags/css/)[menu](https://cn.wordpress.org/plugins/tags/menu/)
   [styles](https://cn.wordpress.org/plugins/tags/styles/)
 *  [高级视图](https://cn.wordpress.org/plugins/extra-classes/advanced/)

## 评级

 5 星（最高 5 星）。

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

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

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

## 贡献者

 *   [ Ben Huson ](https://profiles.wordpress.org/husobj/)

## 支持

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

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