Ordering custom posts by meta field date
You are not querying/saving the correct meta_key. For example, looking at your code, you pass $typename variable to update_post_meta() as meta_key and $typename=”events”. But later in the query you are querying for meta_key = date. Also, you pass $meta as meta_value and in your actual code $meta is an array containing multiple values (location, date, … Read more