I had created a custom search page containing the code
<?php
function filter_where( $where = '' ) {
$where .= " AND post_date >= '{$_GET['frmdate']}' AND post_date < '{$_GET['todate']}'";
return $where;
}
add_filter( 'posts_where', 'filter_where');
$query = new WP_Query( array( 'post_type' => 'post' ) );
while( $query->have_posts() ) : $query->the_post(); ?>
<p><?php the_title(); the_date() ?></p>
<?php endwhile; ?>
<?php remove_filter( 'posts_where', 'filter_where' ); wp_reset_query(); ?>
My Aim is Search posts with 'keywords' between 'Two Dates'
my search variables passing through url like this
www.something.com?page_id=372&s12=lorem&s13=ipsum&frmdate=2012-03-01&todate=2012-06-12
with my Current code to filter the result between two date is Working perfectly when my url is looks like this www.something.com?page_id=372&frmdate=2012-03-01&todate=2012-06-12
when iam adding &s=lorem
isn't work both keyword and date filtering. even I add it (&s=lorem) alone