Skip to main content
1 of 3

Thanks to AmbitiousAmoeba for the answer. The following improved code solves the problem:

function filter_where( $where = '' ) {
   $where .= " AND (($wpdb->postmeta.meta_key = 'original_date' AND $wpdb->postmeta.meta_value >= '2000-01-01') AND ($wpdb->postmeta.meta_key = 'original_date' AND $wpdb->postmeta.meta_value <= '2004-12-31')) ";
   return where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string);
while (have_posts()) :
   the_post();
   the_content();
endwhile;