Archive links in Drop-Down Menu (Combo Box)

Here’s a simple hack you can modify your default theme in WordPress to get your Archive links to show in a drop-down menu (combo box) instead of having it spawn 10+ lines and take up precious space. Under Presentation -> Themes -> Theme Editor -> Sidebar Template, modify the following code

<li><h2>Archives</h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>

to

<li><h2>Archives</h2>
<form name="archive" action="post">
<select name="archiveLinks" size="1" onchange="parent.location = this.options[this.selectedIndex].value;" >
<option value="">Select an Archive</option>
<?php wp_get_archives('type=monthly&format=option'); ?>
</select>
</form>
</li>

Leave a Reply

Your email address will not be published. Required fields are marked *