Subscribe to my RSS Feed ... Or if you prefer, Subscribe by e-mail ... What is RSS?

Too Many Categories, Too Little Room? Here’s the Fix

I started running out of space in the sidebar. There were almost 50 different Categories which ran well past the first fold.

What to do? What to do? I decided I needed to shorten the list, but then things would be mixed together and lose the effect of having categories in the first place.

smileyface.jpg So, I did the next best thing. I added some code to the sidebar which would give me a Drop Down Menu. This way, I would still have all the posts in the proper categories and gain much needed space in the sidebar.

If you would like to set up your Category list with a Drop Down menu (it replaces your get_categories php) like the one in my sidebar…

Here is the code: 

<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>

You, of course, can use the <li> (list) function instead of the <ul class…> function if you prefer, depending on the look you want.

I think it works pretty well, what do you think?

Important Update:

If you followed the comments below at all Des Walsh mentioned that he had problems trying to use the code in his Sidebar. I mentioned that he seemed to be using Widgets as opposed to his normal sidebar php.

Php code doesn’t work using Widgets. I did try, but nothing I tried worked… UNTIL I found a Plugin written 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.

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

New Here? You may want to Subscribe to my RSS feed for daily updates. Or if you prefer, Subscribe by Email Thanks for Visiting! What is RSS?


Related Posts:
  • Add Post Count to Categories in Andreas04 2.0
  • Help Me Get Organized…
  • Want to Go to The Dark Side?
  • This entry was posted in Blogging, Tips. Bookmark the permalink. Both comments and trackbacks are currently closed.
    Print This Post Print This Post

    5 Comments

    1. Posted August 17, 2007 at 12:27 am | Permalink

      Thanks for sharing this. Sidebar clutter is a real challenge and anything that can reduce it without having a deleterious effect on functionality is to be warmly embraced. Now if you can show me how to collapse the tree of archives, that would be the icing on the cake!

    2. Posted August 17, 2007 at 4:24 am | Permalink

      PS: tried it and my whole sidebar disappeared, so I’ve reinstalled the old code and the sidebar with the full list is back – mysterious

    3. Posted August 17, 2007 at 7:45 am | Permalink

      Hey Des,
      Don’t know why it didn’t work for you?!? You can see it works well here.
      Give me a call at 610-931-3600, and I’ll see what I can do. NO CHARGE! (or you can use Jaxtr in the footer and it will be a free call.)
      Because it’s something I suggested. :-)

    4. Posted August 17, 2007 at 9:08 am | Permalink

      Des,
      I just realized you’re in Australia, so talking on the phone might prove difficult.
      I viewed your source code and it seems that you are using Widgets. You can’t uses Widgets and the sidebar php at the same time.
      You would need to replace the code in the Category Widget itself and it should work fine.
      Let me know either here or send me an eMail through my Contact Form
      Joe

    5. Posted August 18, 2007 at 5:26 pm | Permalink

      Hey Des,
      See the Important Update in the post, I think it will solve your problem. :-)


      Welcome...


      I appreciate you taking the time to visit, and hope you enjoy your stay. Look around, there are a lot of interesting posts for you to read and information for you to take with you.
      Contact Me --- Hire Me

      MCBS Consulting
      Help for When the Help Desk Doesn't



      Poll

    • Sorry, there are no polls available at the moment.

    • Working at Home Blog Carnival


      bigtop.jpg
      Join In The Fun

      Recommended by Joe




      Navigation


      --The Way-back Machine--

      ...from March 15, 2007...


      promiseblue0.gif

    • Subscribe via e-mail

      Delivered by FeedBurner

    • Pages

    • Series

    • Categories

    • Archives