Home Plugins majpage menu class extender
MAJpage Menu Class Extender logo

MAJpage Menu Class Extender

by duzymaju on WordPress.org

Adds classes to first, last, parent, even and odd elements of wp_page_menu and wp_nav_menu.

(1)

This simple plugin was written to add classes to first, last, parent, even and odd elements of wp_page_menu and wp_nav_menu to support recognizing it in older browsers without :first-child, :last-child and :nth-child supporting.

Plugin adds the following classes to menu

  • tags:

    • “first-menu-item” to every first child of
        or tag,
      • “last-menu-item” to every last child of
          or tag,
        • “parent-menu-item” to every child of
            or tag that has another
              or tag inside (a parent to another menu level),
            • “odd-menu-item” to every odd child of
                or tag, including first and/or last child,
              • “even-menu-item” to every even child of

                  or tag, including first and/or last child.

                  Above classes are added separately to each menu level. Plugin use SimpleXML extension and requires PHP 5 or higher. Menu should have valid XHTML code.

  • Active installations60+
    Weekly downloads
    14-33.33%
    Version1.6
    Last updated9/8/2019
    WordPress version3.0.0
    Tested up to5.2.21
    Tags
    classesmenutagswp_nav_menuwp_page_menu