Display Archives Normally or in a Drop-Down Box


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <h2>Archives</h2>
  2. <ul>
  3. <?php wp_get_archives('type=monthly'); ?>
  4. </ul>
  5.  
  6.  
  7. <select name=\"archive-dropdown\" onChange='document.location.href=this.options[this.selectedIndex].value;’>
  8. <option value=\”\”><?php echo attribute_escape(__(’Select Month’)); ?></option>
  9. <?php wp_get_archives(’type=monthly&format=option&show_post_count=1′); ?> </select>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.