Daily Tip: How To Display WordPress Archives in a Drop Down Menu
May 12, 2010
Sometimes you don’t want your archives taking up so much space in your sidebar or footer or elsewhere. Here’s a snippet that you can add anywhere in your template files to display a drop down menu of your archives in order to conserve space:
<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>
This will produce a little something like what’s shown in the thumbnail above.
Source: WPhacks.com



Comments
Got something to say?