Top

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&amp;format=option&amp;show_post_count=1'); ?> </select>

This will produce a little something like what’s shown in the thumbnail above.

Source: WPhacks.com

Tweet This Post

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.