Fancy Categories For Wordpress
This is a very simple plugin that uses Javascript to form a collapsable set of links in the sidebar for the categories. Each sub category will be placed "below" its parent in a logical hierarchy.
Demo
You can view a demo of this plugin at my Wordpess demo page here.
Installation
Unpackage contents to wp-content/plugins/ so that the files are in a fancy-archives directory. Now enable the plugin. To use the plugin, change the following where appropriate (most likely sidebar.php):
<?php wp_list_categories(...); ?>
To something of the following:
<?php
if( function_exists('list_fancy_categories') ) {
echo "<li>\n<h2>Categories</h2>";
list_fancy_categories();
echo "</li>\n";
} else {
wp_list_categories(...);
}
?>
Note: Replace the above ... with whatever the correct arguments for your
theme are.
The above will fall back to the WP function for categories if you disable the plugin.
Options for the Fancy Categories plugin include:
- Show post count in category links
- Include sub-category totals in parent link
- Text to show for category link (%title, etc)
- Limit title length to a set number of characters
- Add a '...' to the end of shortened category titles
Fancy Categories also looks at the current URL of the user's browser to determine if the user is looking at a category page. If the URL is a category page, that category is auto-magically expanded. This allows even those without javascript to enjoy this plugin.