TRying to sort events by date in module

Home Forums Calendar Products Events Calendar PRO TRying to sort events by date in module

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1109261
    James
    Participant

    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”>

    See All

    <?php echo $heading; ?>

    </div>

    <div class=”list-group” data-compare>

    <?php $args = array( ‘orderby’ => ‘date’); foreach($events as $event ): ?>

    ” class=”list-group-item”>
    <?php render_template(‘subtitle-with-date’, array(‘text’ => $event[‘title’], ‘date’ => $event[‘date’])); ?>

    <?php endforeach; ?>

    </div>

    </div>

    </div>

    #1109489
    Brian
    Keymaster

    Hi,

    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

    #1115404
    Support Droid
    Keymaster

    This 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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘TRying to sort events by date in module’ is closed to new replies.