My Computer Back in Service

"Make Your Computer Smile Again!"

happyscreen.JPG

Put a Drop Down Menu for Categories in the Sidebar

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.



  • From the Archives

  • Subjects

  • Look-up Posts by Date

    September 2007
    S M T W T F S
    « Aug   Dec »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    30