sorting by repeatable dates (unix timestamps)
-
Hi,
I have an events metabox where a user can input the dates the event is on using a repeatable field. The group field’s id is ‘_g_dates’.
This is working well. See working example
However I can’t create an archive page for the events where they are sorted by the repeatable date. In the example below Id like to show all the events before Jan 1st 2016. But the arguments below return no results. I’m guessing this is because ‘_g_dates’ is an array.
$args = array( 'post_type' => 'events', 'meta_key' => '_g_dates', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_query' => array( array( 'key' => '_g_dates', 'value' => '1451520000', 'compare' => '<=', ), ));
See here
If anyone can point me in the right direction I’d appreciate it (even if it’s “This is the wrong approach, you need to start over”).
Many thanks,
??
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘sorting by repeatable dates (unix timestamps)’ is closed to new replies.