Collapsing Category Menus Plugin

Thursday, October 5th, 2006

Collapsing Category Menus is a WordPress 1.5+ plugin that generates a collapsing menu of your post categories as an unordered list. The current category or the current post’s category are tagged with a css class allowing you to highlight them. The current version is 0.1 and was released on October 5, 2006.I have not tested this plugin under WordPress versions earlier than 1.5. However, I suspect it works correctly in most WordPress versions.Please submit any comments, bug reports, and other issues in the comments to this post.

Download

Collapsing Category Menus[.zip ]

Installation

Collapsing Category Menus is installed by decompressing the zip file above and uploading the collapsing_category_menu.php file to your plugins directory (/wp-content/plugins/) and then enabling the plugin in the WordPress Plugins administration screen.

Use

Once you’ve activated the plugin, you can produce a collapsing category menu by inserting the following in your template file:< ?php echo collapsing_category_menu(); ?>The function also has 6 parameters that you can use to tailor the display of the unordered list.collapsing_category_menu ( $root_id = 0, $order_by = 'cat_name', $order_dir = 'ASC', $css_li = 'page_item', $css_li_selected = 'current_page_item', $current_id = '' )

  • $root_id: The parent page ID. If you’d like to have all of your pages in the menu, use 0. To show only sub-pages of a particular page, use that page’s ID. Note that the given page will not display as part of the menu.
  • $order_by: The database field to use for record ordering.
  • $order_dir: The direction in which to order the pages.
  • $css_li: The CSS class for every page li.
  • $css_li_selected: The CSS class for the current page li.
  • $current_id: Override in cases where the $post variable is compromised or inaccurate. Most of the time, you won’t need to use this parameter.

Demos

If you have found the plugin useful, please leave me a comment with a link to your site and I will add it here.

Version History and Changelog

  • 0.1 - 2006-10-05 Initial release.

Related Plugins

TAGS: , , , , , , , ,