For highly-categorized and deeply-hierarchical sites, showing a full list of categories and subcategories can take up a lot of space in your design. To get around this, you can change your categories list from static to dynamic by using a simple JavaScript technique.
First, download the Superfish package from http://users.tpg.com.au/j_birch/plugins/superfish/ and place all of the JavaScript files contained within it in your theme directory. Next, insert the following code in your theme's<head>
section, above the wp_head
function call:
<?php wp_enqueue_script('superfish', get_bloginfo( 'stylesheet_directory' ) . '/superfish.js', array('jquery')); ?>
Place the following code after the wp_head
call:
<script type="text/javascript"> // <![CDATA[ jQuery(document).ready(function() { jQuery('ul.superfish').superfish(); }); // ]]> </script>
Now, open the template file in which you wish to display your Category drop-down...