now idea why this isn't working, please point me in the right direction!
Here's my main query;
$events = new WP_Query( array( 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => '_event_date', 'value' => time(), 'type' => 'NUMERIC', 'compare' => '<' ), ), ) );
Each post has a custom field (_event_date) which is saved as a UNIX timestamp. I simply need to compare time() to this value to get posts with an older timestamp or posts with a newer timestamp. Here's the SQL that WP generates;
INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1
AND wp_posts.post_type = 'post'
AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
( wp_postmeta.meta_key = '_event_date' AND CAST(wp_postmeta.meta_value AS SIGNED) < '1419072968' )
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
Is this the correct way to query by a UNIX value? I've noticed there are other
type settings, such as "date", "time" and so on. None of these seem to work.