Tag Info

New answers tagged


You need to use a meta_query to query custom fields. If you are going to store date and time in custom fields for the purpose of ordering or comparisons, you will need to store it in the format of yyyy-mm-dd h:m:s or as a unix timestamp. If you have two custom fields start and end and you need to get posts between a cetain start and end date, you can try ...


There's no need for the custom meta SQL filter - the beauty of storing dates in the format Ymd is that you can treat them numerically, and MySQL will still be able to find events in a given "range" and sort them ascending/descending. I've done this recently on another site using ACF for start/end date: if ( ! empty( $_GET['_y'] ) ) $year = absint( ...

Top 50 recent answers are included