Extra Classes

plugin banner

Adds classes for selected menu states such as highlighting categories when viewing a blog post or parent page when viewing an attachment page.

Author:Ben Huson (profile at wordpress.org)
WordPress version required:3.7
WordPress version tested:4.2
Plugin version:0.3.1
Added to WordPress repository:11-02-2013
Last updated:23-04-2015
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:3
Plugin URI:https://github.com/benhuson/extra-classes
Total downloads:2 375
Active installs:40+
plugin download
Click to start download

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.

FAQ
ChangeLog