exposed filter dropdown by year I am looking for a way to produce a dropdown filter by year of drupal 'post date'. i was able to produce somewhat of this result with an exposed criteria but that requires updating. 

Is there a way i can just make the sort criteria exposed with dropdown of years? 

this is what i have so far 

if ($form_id == 'views_exposed_form_clone_of_post_by_date_block'){ 
  $year_filter = array();
  $years = array(); 
  $counter = 0; 
  for ($i=date("Y");$i&gt;=2009;$i--){ 
    $counter++;
    $years[$counter]=$i; 
    $dstart = $i."0101"; 
    $dend = $i."1231"; 
    $year_filter[$counter] = array('title'=&gt;$i,'operator'=&gt;'between','value'=&gt;array('type'=&gt;'date','value'=&gt;$‌​i,'min'=&gt;$dstart,'max'=&gt;$dend)); 
    $form_state['input']['edit_created']['#options'] = $years; 
  }
How to produce a dropdown filter by year of post date isn't as immediately obvious as you might think - but it doesn't need any custom code when using Drupal 7 with views.

Within your view add a new filter. You might think you need to choose 'Content: Post date' but this will not give you the options you need. You should actually choose 'Date: Date (node)'. For data selection form element choose 'select' to create your dropdown. Set Filter granularity to 'year'. Give a starting year e.g. '-10 years from now' and an ending year e.g. '+ 0 years from now'. Then in 'date fields' you select where the date(s) are drawn from, it is here that you choose the 'content: post date'.

It is worth noting that other date fields are exposed here, so you are not limited to the post date.