Thread Starter
Sara99
(@sara99)
I am using this code but it’s not working. What arguments and value can I use instead?
$args[‘post_type’] = ‘tribe_events’;
$args[‘start_date’] = ‘now’;
$args[‘orderby’] = ‘_start_date’;
$args[‘order’] = ‘ASC’;
For event start date use _EventStartDate
. This will solved problem,
I used this function
function( $query ) {
$meta_query = (array)$query->get( 'meta_query' );
$query->set( 'meta_query', $meta_query );
$query->set( ‘orderby’, ‘meta_value’ );
$query->set( ‘meta_key’, ‘_EventStartDate’ );
$query->set( ‘order’, ‘ASC’ );
});
Thread Starter
Sara99
(@sara99)
Thanks for your reply!
I don’t know how to use this code in my code…
I am doing this to build my list of events:
$args = array(‘posts_per_page’ => 7);
$args[‘post_type’] = ‘tribe_events’;
How can I use your code in my code?
Thank you!
Sara
Hi there,
You could make use of our Events List widget to achieve the results you want. You can read more about it here: https://theeventscalendar.com/knowledgebase/k/configuring-the-event-list-widget/
Best regards,
Marho
Hi there,
This thread has been pretty quiet for a while, so we’re going to go ahead and close it. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Have a great day.
Kind regards,
Masood