I have a bunch of posts belonging to category 6, each having the same meta fields. I'm interested in two fields in particular: "pce_monday_open" and "pce_monday_close", both of which have numeric values.
I want to run a query_posts() query that returns posts in category 6, and where some number, $pce_time, is in between the values of the two meta fields. My current query argument is:
$pce_arg = array(
'cat' => 6,
'meta_query' => array(
array('key' => 'pce_monday_open', 'value' => $pce_time, 'compare' => '<=' ),
array('key' => 'pce_monday_close', 'value' => $pce_time, 'compare' => '>=' )
)
);
Unfortunately this doesn't seem to be working, and no posts are being returned. My search seems to work fine with other query parameters (such as searching other meta fields for an exact match), so I think there is an issue with my comparison parameters.
Is there something obviously wrong with what I've written? Or is it correct, and the issue might lie elsewhere?