title: Showing posts between a certain date range
body: <p>Trying to display my custom post types for specific date ranges. I want to show posts only within a certain month. I know I need to hook into the posts_where filter, but I can not figure out how to pass arguments to this function, as I need to pass the date range.</p>
  
  <p>I have seen plenty of examples of how to alter the WHERE clause to take a date range, but only when static. I need to do the following:</p>
  
  <pre><code>add_filter('posts_where', 'my_custom_where', '', '04/2011'); //pass my date to the filter
  
  function my_custom_where( $where = '' ) {
  
      //figure range  
      $range = array(
          'start' =&gt; $date . '-1',
          'end' =&gt; $date . '-' . cal_days_in_month(CAL_GREGORIAN, date('m', $date), date('Y', $date))
      );
  
      $where .= " AND post_date ....."; //build where with date range
  
      return $where;
  
  }
  </code></pre>
  
  <p>Hope that makes sense. Any help would be appreciated.</p>