I'm dynamically building a query into a variable called $qstring and then executing it
When it looks like post_type=post&posts_per_page=4&order_by=modified&monthnum =12&year=2012&offset=8 it pulls back everything from 2012, rather than just December.
Is there something amiss with my query formatting? It is in an ajax call so nothing else should be interfering with it.
The whole function looks like this:
function load_more(){
$offset = $_REQUEST['offset'];
$qstring = 'post_type=post&posts_per_page=4&order_by=modified';
if (isset($_REQUEST['cat'])){ $qstring .= '&cat='.$_REQUEST['cat'];}
if (isset($_REQUEST['tag'])){ $qstring .= '&tag_id='.$_REQUEST['tag'];}
if (isset($_REQUEST['month'])){ $qstring .= '&monthnum ='.$_REQUEST['month'];}
if (isset($_REQUEST['year'])){ $qstring .= '&year='.$_REQUEST['year'];}
$qstring .= '&offset='.$offset;
echo '<div>';
// echo '<p>'.$qstring.'</p>';
$query = new WP_Query( $qstring );
$result = null;
while ( $query->have_posts() ) {
$query->the_post();
my_print_post();
}
echo '</div>';
exit();
}