=== Codepress Menu === Contributors: davidmosterd, tschutter Tags: wordpress, menu, navigation, php, code Requires at least: 3.1 Tested up to: 3.4 Stable tag: 2.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html A better take on displaying a WordPress menu in your theme. == Description == Generates a WordPress tree menu using ul and li tags. No configuration required but a few runtime parameters can be used to tweak the menu: * **depth** How many submenu levels to return from a WordPress menu (defaults to 0, which means all). * **level** Returns the menu tree from current submenu on. Starts at the branch which contains active menu item and can be used in conjunction with depth (defaults to 0). * **location** The menu location (defaults to 'main'). * **class** Assign a CSS class to the top ul tag of a menu (defaults to none). **Examples** The most basic usage: display the menu for the 'main' location. ` echo new codepress_menu(); ` This will get a menu tree with 2 levels (resulting in menu + submenu). ` $menu = new codepress_menu( array( 'depth' => 2, )); echo $menu; ` This will get the first submenu from the active branch with 3 levels (resulting in menu + submenu + submenu). ` $menu = new codepress_menu( array( 'level' => 1, 'depth' => 3, )); echo $menu; ` Register a new menu location and assign a class to it. ` codepress_menu::register('footer', __('Footer navigation')); $menu = new codepress_menu( array( 'location' => 'footer', 'class' => 'footer-nav' )); echo $menu; ` Aimed on simple use on various use cases. ` $menu = new codepress_menu( array( 'depth' => 1, 'class' => 'main-nav', )); // menu in header echo $menu; // change parameters... $menu->setDepth(2) ->setLevel(1) ->setClass('side-nav'); // ... and use as submenu on the side echo $menu; ` **Also** * Implements filters for control over the default menu class (codepress_menu_class) and the title of a menu item (codepress_menu_title). * Uses a very compact set of CSS classes for styling: li.active, li.active-parent, li.active-ancestor, li.first-item, li.last-item. == Installation == 1. Upload codepress-menu to the /wp-content/plugins/ directory 2. Activate Codepress Menu through the 'Plugins' menu in WordPress 3. Use the menu anywhere you like in your theme == Changelog == = 2.0 = * Initial public release.