WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is my current code which shows a dropdown list of all years daily post archive.

<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> 
  <option value=""><?php echo attribute_escape(__('Select Issue')); ?></option> 
  <?php wp_get_archives('type=daily&format=option'); ?> </select>

But i want to show a specific year daily post archive into dropdown list. (eg. only 2010 daily post archive will show into dropdown list)

Pls help me.

Thanks in advance, Onirban

share|improve this question
side note FYI: attribute_escape [has been deprecated][1] in favor of esc_attr [1]: codex.wordpress.org/Function_Reference/attribute_escape – daxitude Mar 13 '11 at 21:58
function foo($where) { return $where . ' AND  YEAR(post_date) = 2010 '; }
add_filter('getarchives_where', 'foo', 1, 10);
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php esc_attr_e( __('Select Issue') ); ?></option>                                                               
<?php wp_get_archives('type=daily&format=option'); ?>
<?php remove_filter('getarchives_where', 'foo', 1, 10); ?>
share|improve this answer
wow great!!! its working .. thank you very much Marchin... and also thanks to daxitude for informed us new function. – user3940 Mar 14 '11 at 19:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.