Support

Home Forums Event Espresso Premium Meta key

Meta key

Posted: April 17, 2017 at 1:15 am

Viewing 1 reply thread


ATi

April 17, 2017 at 1:15 am

What is the meta key for start date?
`
$args2 = array(
‘post_type’ => ‘espresso_events’,
‘meta_key’ => ‘start_date’,
‘orderby’ => ‘meta_value’,
‘order’ => ‘ASC’,
‘posts_per_page’ => 10,
‘post__in’ => (count($mergeLocation) > 0 ? $mergeLocation : [0]),
‘paged’ => $page,
);

Currently this code does not show the events.


Josh

  • Support Staff

April 17, 2017 at 2:07 pm

Hi there,

The start date for an event isn’t actually stored in a meta_key on the event post. Those are stored in the esp_datetime database table, and can be retrieved using the models system. You can review an example of how the Event Espresso widget does its query which includes ordering by the datetime start date:

https://github.com/eventespresso/event-espresso-core/blob/master/widgets/upcoming_events/EEW_Upcoming_Events.widget.php#L322

Viewing 1 reply thread

The support post ‘Meta key’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso