Create a WordPress dropdown monthly archives

Screen shot of dropdown monthly archivesI’m absolutely thrilled to have been able to get a dropdown monthly archive at the sidebar finally!

This display is so very short, just perfect to replace the default one that was getting way too long, which will continue growing in length as long as new posts are being added.
Learn how to change that here!

A big thank you to Michael Martin of Pro Blog Design for his awesome tip on how to get this dropdown list!

Here’s how to get a dropdown list of your monthly archives
by just following these simple steps:

  1. Go to Site Admin | Editor | Sidebar (sidebar.php)
  2. Scroll down to find the following code :
    <?php wp_get_archives('type=monthly'); ?>
  3. Remove the above code and replace with this new code :
    <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
    <option value=""><?php echo attribute_escape(__('Select Month')); ?></option>
    <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>
  4. Click Update File to save edit and you’re done! Easy, huh!

Check further at WordPress Codex to learn other various ways to display archives list on your website.

Update: February 22 2010
Do check this recent article about creating an Archives page, using the WP_Archives plugin, if you’re interested to improve further. It’s truly a wholesome alternative way to have your archived posts with titles and dates automatically generated, with links that are beautifully displayed too.

Jacq's Signature

Tags: , , , ,


2 Responses to “Create a WordPress dropdown monthly archives”

  1. Michael Martin Says:

    Glad you liked the post Jacqueline! If there’s ever anything else you’d like to do, drop me an email and I’ll make sure to write up a post on it! :)

  2. Jacqueline Says:

    Thanks so much for the offer, Michael. You’re a gem!
    Have a lovely Friday and wonderful weekend ahead.

Welcome! You are valuable to us and we love to hear from you. Leave us a comment or share your experiences. Also, please inform us if you find a broken link in any of our articles. Thank you.