Title: dropdown categories
Last modified: August 18, 2016

---

# dropdown categories

 *  Resolved [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/)
 * Hi. I tried using this [http://codex.wordpress.org/Template_Tags/dropdown_cats](http://codex.wordpress.org/Template_Tags/dropdown_cats)
   to create a dropdown categories without a submit button. I pasted it into my 
   sidebar, but it didn’t work properly. It displays the words “by section” in a
   pulldown, but then the category names are just next to it, not in the pulldown.
 * Any help is much appreciated!
 * Hilary

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/dropdown-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/dropdown-categories/page/2/?output_format=md)

 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255166)
 * Went to your site but not only didn’t see the error, but also didn’t dee any 
   category list.
 *  Thread Starter [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255168)
 * Yeah I took it down because it doesn’t work.
 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255243)
 * Well, I suspect it does work as I have used it before – just not the way you 
   added it 😉
 *  [brittanie](https://wordpress.org/support/users/brittanie/)
 * (@brittanie)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255352)
 * I am having the same problem, but only in Explorer, version 6.0. The drop dowm
   menu looks and works great in Safari and Firefox. Any ides? Here is the code 
   for my sidebar:
 * ‘ <div id=”sidebar”>
    -  <!– Author information is disabled per default. Uncomment and fill in your
      details if you want to use it.
    - <h2><?php _e(‘Author’); ?></h2>
       A little something about you, the author.
      Nothing lengthy, just an overview.
    -  –>
    - <h2>
       <?php wp_list_pages(‘title_li=’); ?> </h2>
    -  <!– WordPress Calendar is disabled per default. Remove the html comment tags
      if you want to use it.
       <li id=”calendar”> <?php get_calendar(2); ?>
    -  –>
    - <h2><?php _e(‘Archives’); ?></h2>
 *  -  <form id=”archiveform” action=””>
       <select name=”archive_chrono” onchange
      =”window.location = (document.forms.archiveform.archive_chrono[document.forms.
      archiveform.archive_chrono.selectedIndex].value);”> <option value=”>Select
      month</option> <?php get_archives(‘monthly’,”,’option’); ?> </select> </form
      >
 *  - <h2><?php _e(‘Categories’); ?></h2>
 *  -  <form name=”catform” action=”<?php echo $PHP_SELF ?>”>
       <select name=”cat”
      onchange=”submit(this.form)”> <option value=”>Select category</option> <?php
      dropdown_cats(); ?> </select> </form>
 *  - <h2><?php _e(‘Previously’); ?></h2>
 *  -  <?php wp_get_archives(‘type=postbypost&limit=5’); ?>
 *  <?php /* If this is the frontpage */ if ( is_home() || is_page() ) : ?>
    <?php
   get_links_list(); ?>
    - <h2><?php _e(‘Meta’); ?></h2>
 *  -  <?php wp_register(); ?>
    - <?php wp_loginout(); ?>
    - [“><?php _e(‘Valid XHTML’); ?>](http://validator.w3.org/check/referer)
    - [XFN](http://gmpg.org/xfn/)
    - [“>WordPress](http://wordpress.org/)
    -  <?php wp_meta(); ?>
 *  <?php endif; ?>
    - <h2>Search me</h2>
       <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
 *  </div>
 * ‘
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255353)
 * Try to put some parameters in this line
    ` <?php dropdown_cats(); ?>` e.g. I 
   am using `<?php dropdown_cats('TRUE', '', 'name'); ?>` (without parameters I 
   also experienced the categories being displayed in the wrong place). Of course,
   you can set the parameters to your needs.
 *  [brittanie](https://wordpress.org/support/users/brittanie/)
 * (@brittanie)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255355)
 * Moshu-
 * I tried that, but I’m still having the same problem. Everything looks great, 
   as I said, in Firefox and Safari, but IE 6.0 is kicking my booty.
 *  Thread Starter [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255356)
 * I think I’m having the same problem as Brittanie, because mine works fine in 
   Firefox but does not work in IE as well.
 * Anyone have any suggestions?
 *  [brittanie](https://wordpress.org/support/users/brittanie/)
 * (@brittanie)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255366)
 * Superjux-
 * I got this to work using this code:
 * `<li><h2><?php _e('Categories'); ?></h2>
    <ul> <li> <form name="catform" action
   ="/wordpress/index.php" method="get"> <select name="cat" onchange="submit(this.
   form)"> <option value=''>Select Category</option> <?php dropdown_cats(); ?> </
   select> </form> </li> </ul> </li>
 * But I also had to edit my template-functions-category.php file to make the hack
   valid. Once I did, it solved the links outside of the box problem.
 * Edit your template-functions-cat file to comment out lines 208 (echo “<select
   name=’cat’ class=’postform’>n’;)
    and line 227 (echo “/select>n”;)
 *  Thread Starter [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255372)
 * That worked! Thanks!
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255373)
 * To comment out in php, you just add the two // to the start of the line.
    In 
   wp 1.5.2, it’s actually line 201, which is this: ` echo "<select name='cat' class
   ='postform'>n";` so to comment that out: ` // echo "<select name='cat' class='
   postform'>n";`
 * and the other line is 220:
    ` echo "</select>n";` make that ` // echo "</select
   >n";`
 *  Thread Starter [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255374)
 * Thanks so much Brittanie and Podz! It appears to have worked, but…is it possible
   to list the categories alphabetically instead of the random order they’re in?
 *  [brittanie](https://wordpress.org/support/users/brittanie/)
 * (@brittanie)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255375)
 * It should be possible, because I was able to exclude a category using the “hide”
   parameter. Try <?php dropdown_cats(‘sort_order=name’); ?> I’m going to test it
   on my site too.
 * I, however, am still having issues with permalinks. You can select a category
   from the post meta data and be taken to:
    [http://abroad-abroad.org/index.php/category/everyday/](http://abroad-abroad.org/index.php/category/everyday/),
   but when you select the same category from the dropdown, it takes you to: [http://abroad-abroad.org/index.php?cat=1](http://abroad-abroad.org/index.php?cat=1).
 * It’s the same exact page, but the category permalinks don’t work when you select
   from the drop-down.
 *  Thread Starter [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255377)
 * I don’t get it…your permalinks work fine for me.
 *  [brittanie](https://wordpress.org/support/users/brittanie/)
 * (@brittanie)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255378)
 * Really? Try this – when you select a category from the sidebar’s drop-down menu,
   what address comes up in the browser? Can you post the address you’re getting
   here so I can see. Because the issue is that the drop-down menu takes you to 
   the correct PAGE, but it doesn’t show the category name in the URL. It shows 
   the category ID instead. If you select a category link from directly UNDER a 
   post, the URL on the new page features the category “pretty” permalink, as it
   should. What is the point of having pretty permalinks if you are still seeing
   the cat ID as opposed to the cat name in the URL?
 *  Thread Starter [superjux](https://wordpress.org/support/users/superjux/)
 * (@superjux)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/#post-255379)
 * Ohhh, sorry, I misunderstood you. You’re right. That is kinda lame, and I just
   noticed it on mine now too.
 * also, I tried that <?php dropdown_cats(‘sort_order=name’); ?> but it didn’t work.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/dropdown-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/dropdown-categories/page/2/?output_format=md)

The topic ‘dropdown categories’ is closed to new replies.

## Tags

 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 5 participants
 * Last reply from: [superjux](https://wordpress.org/support/users/superjux/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/dropdown-categories/page/2/#post-255381)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
