Title: Dropdown Archives
Last modified: August 18, 2016

---

# Dropdown Archives

 *  [carthik](https://wordpress.org/support/users/carthik/)
 * (@carthik)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/dropdown-archives/)
 * Hi,
    I was looking around after 2 hours of pottering around with code, trying
   to get a dropdown archive thingy set up on my webpage, [carthik.net](http://carthik.net).
   [The wp archives templates](http://wordpress.org/docs/template/#archives) tells
   me that the format=option parameter will give me a list that can be within a 
   dropdown menu. Can someone please please write me a small menu which uses this
   method? I can’t get this done for the life of me. How is the format = ‘option’
   supposed to be used to generate dropdown menus? I found an earlier thread with
   [a hack](http://www.orbert.net/wpressdev/public/hacks/001/) that does not work
   now. All the hack gives me is “january 2004” as the first and last option 🙂 
   All help leads to good karma 🙂

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Thread Starter [carthik](https://wordpress.org/support/users/carthik/)
 * (@carthik)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/dropdown-archives/#post-39579)
 * I found something at [mrxss.com](http://www.mrxsss.com/blog/stuff/wp_dropDown_menus.txt)
   which does what I want…
    but that uses javascript , I guess…isn’t that a bad 
   thing, if someone doesn’t have javascript enabled?
 *  [danithew](https://wordpress.org/support/users/danithew/)
 * (@danithew)
 * [22 years ago](https://wordpress.org/support/topic/dropdown-archives/#post-40162)
 * I’d be interested in reading an answer to 2fargon’s question, whether this code
   at mrxss.com is the way to go for a dropdown archives menu.
 *  Thread Starter [carthik](https://wordpress.org/support/users/carthik/)
 * (@carthik)
 * [22 years ago](https://wordpress.org/support/topic/dropdown-archives/#post-40163)
 * I now use this on my blog..
    ` <li id="archives">Archives:
 * <ul>
 * <li><a href=""<?php">/narchives.php">Categorized, sortable archives</a></li>
 *  <li><form name="archiveform" action="">
    <select name="archive_chrono" onchange
   ="window.location = (document.forms.archiveform.archive_chrono[document.forms.
   archiveform.archive_chrono.selectedIndex].value);">  <option value=''>By Month
   </option> <?php get_archives('','','option', 1); ?> </select>  </form></li>
 *  </ul>
 *  </li>
 * Adapt it to your use. I posted the entire archives ul, only part of it is used
   for the dropdown archives.
 *  [karan](https://wordpress.org/support/users/karan/)
 * (@karan)
 * [22 years ago](https://wordpress.org/support/topic/dropdown-archives/#post-40182)
 * I played around with that but I couldn’t get it to work with WP 1.2, until I 
   started digging into the actual function code…
    this is what works for me: ` 
   <form name="archiveform" action=""> <select name="archive_chrono" onchange="window.
   location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.
   archive_chrono.selectedIndex].value);"> <option value=''>By Month</option> <?
   php wp_get_archives('format=option'); ?> </select> </form>
 *  [mog](https://wordpress.org/support/users/mog/)
 * (@mog)
 * [22 years ago](https://wordpress.org/support/topic/dropdown-archives/#post-40183)
 * Works perfectly for me. thanks.
 *  [cb1977](https://wordpress.org/support/users/cb1977/)
 * (@cb1977)
 * [22 years ago](https://wordpress.org/support/topic/dropdown-archives/#post-40184)
 * Put it into my code and it works great. Now how would I change it so display 
   archives by category?
    p.s. Sorry for the novice question.
 *  [kpont](https://wordpress.org/support/users/kpont/)
 * (@kpont)
 * [22 years ago](https://wordpress.org/support/topic/dropdown-archives/#post-40185)
 * This is what I use and it works for me. Grabbed it off the forums here the other
   day.
    `<li id="categories"><?php _e('Categories:'); ?>`
 * <ul>
    <form name="catform" onchange="window.location = 'index.php?cat='+(document.
   forms.catform.cat[document.forms.catform.cat.selectedIndex].value);"> <?php dropdown_cats();?
   > </select> </form> </ul> </li>
 *  [steadyvibe](https://wordpress.org/support/users/steadyvibe/)
 * (@steadyvibe)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/dropdown-archives/#post-40271)
 * Is that supposed to show the archives of a specific category? It does not work
   for me?
 *  [samsarin](https://wordpress.org/support/users/samsarin/)
 * (@samsarin)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/dropdown-archives/#post-40273)
 * I recently posted an article that explores in depth a method for adding drop 
   down archives both by date and by category. It also includes support for hierarchical
   categories and includes javascript redirection. The article can be found here:
   [http://samsarin.com/2006/07/28/dropdown-archives-in-wordpress/](http://samsarin.com/2006/07/28/dropdown-archives-in-wordpress/).
 *  [immaterial](https://wordpress.org/support/users/immaterial/)
 * (@immaterial)
 * [19 years, 6 months ago](https://wordpress.org/support/topic/dropdown-archives/#post-40276)
 * kpont, I tried out your code and it works for me. Since I don’t know much about
   php I’d like to know how to bring back the article quantity for each category
   and show it in my dropdown menu.
 * As well, I’d like to know how to put an information in the first line of the 
   dropdown menu, so that it is shown as long as the menu is idle, like, for example“
   choose category”.
 * Last but not least, how do I change the code so that it shows the archives instead
   of categories.
 * Merci a lot.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Dropdown Archives’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 9 participants
 * Last reply from: [immaterial](https://wordpress.org/support/users/immaterial/)
 * Last activity: [19 years, 6 months ago](https://wordpress.org/support/topic/dropdown-archives/#post-40276)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
