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.

Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • LinkedIn
  • Facebook
  • Twitter
  • Google Bookmarks
  • Print
  • email

One Response to “Put a Drop Down Menu for Categories in the Sidebar”

  1. I`ve read few of articles here and could say it was really interesting, thanks for sharing this.

Leave a Reply

  • From the Archives

  • Subjects

  • Look-up Posts by Date

    July 2010
    S M T W T F S
    « Jun    
     123
    45678910
    11121314151617
    18192021222324
    25262728293031