Home › Forums › Calendar Products › Events Calendar PRO › TRying to sort events by date in module
- This topic has 2 replies, 3 voices, and was last updated 7 years, 11 months ago by Support Droid.
-
AuthorPosts
-
May 1, 2016 at 2:39 am #1109261JamesParticipant
Hi there,
I have a module on the frontpage of my site which provides a feed of upcoming events.
At the moment, it is not correctly displaying events by event date and it is showing expired events as well.http://b4-business.white-staging.co.uk/
It’s the member events module at the bottom.
Could you help me identify the problem with my code?
<?php
extract(array(
‘events’ => []
), EXTR_SKIP);$heading = (($heading) ? $heading : ‘Member Events’);
?><div class=”col-xxs-12 col-xs-6 col-md-3 isotope-item”>
<div class=”panel panel-default module module-member-event”>
<div class=”panel-heading”>
<?php echo $heading; ?>
</div>
<div class=”list-group” data-compare>
<?php $args = array( ‘orderby’ => ‘date’); foreach($events as $event ): ?>
<?php endforeach; ?>
</div>
</div>
</div>
May 2, 2016 at 7:28 am #1109489BrianKeymasterHi,
Thanks for using our plugins. I can try to help out here, but I am limited in supporting customizations.
When you orderby date it does the publish date of the event and not the Event’s start date.
This is what we use to orderby the Start Date:
'meta_key' => '_EventStartDate',
'orderby' => array('menu_order' => 'ASC','meta_value_datetime' => 'ASC',)We also have tribe_get_events that orders by startdate:
https://theeventscalendar.com/knowledgebase/using-tribe_get_events/
Let me know if you have any follow up questions.
Thanks
May 17, 2016 at 9:35 am #1115404Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘TRying to sort events by date in module’ is closed to new replies.