Put a Drop Down Menu for Categories in the Sidebar
Posted by Joe Hauckes
If you're new here,
You may want to Subscribe to my RSS Feed or if you prefer ... Subscribe via e-mail. Thanks for visiting!
I was asked by a few readers on my Working at Home on the Internet Blog about the procedure for putting a Drop Down Menu in the Sidebar for the Categories. It seems I’m not the only one who has too many categories and not enough room to show them all.
It is a fairly simple bit of code to add a Drop Down Menu…
- Go to your Sidebar php
- Locate the code <?php get_categories (); ?> or <?php wp_list_cats (); ?>
- Replace that code with the following:
- <h2>Categories</h2>
<ul class=”sellLi”>
<form action=”<?php bloginfo(’url’); ?>” method=”get”>
<?php wp_dropdown_categories(’show_count=1&hierarchical=1&orderby=name’); ?><br />
<input type=”submit” name=”submit” value=”View” />
</form>
</ul> - Save your Sidebar php
- Done
If you are using Widgets, you may need to get a plugin by Otto that allows the use of php code within a Widget! Go to his post Fun with Widgets and look for the execphp.zip file.
Download it, unzip it, upload it to your server wp-plugins file and you will be able to use the above php code in the Widgets and you will have the same DropDown Menu you see in my Sidebar on the WAHI Blog.
Related Posts:




Leave a Reply