Order by meta value or date?
If you can explain it in SQL, you can query for it! There are three places where we want to change the default query: SELECT wp_posts.* FROM wp_posts 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”) AND wp_postmeta.meta_key = ‘startDate’ AND CAST(wp_postmeta.meta_value AS CHAR) < ‘2011-03-23’ GROUP BY wp_posts.ID ORDER … Read more