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

link|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
feedback

1 Answer

<?php
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'); ?>
</select>                                                                       
<?php remove_filter('getarchives_where', 'foo', 1, 10); ?>
link|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
feedback

Your Answer

 
or
required, but never shown