Order list by startdate

Home Forums Calendar Products Events Calendar PRO Order list by startdate

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1308408
    adformation
    Participant

    Hi all!

    We are using “tribe_events_list ” shortcode on our website, and we have a problem.
    We can’t seem to change the order of the events – we would like it to order events by start date instead of end date.
    How do we do this?

    Right now the dates are a mess!

    Do we need to add an array to “tribe_get_list_widget_events()” – if so – what array?
    We’re kind of stuck on this issue.

    Best regards
    Aris Kuckovic

    #1311189
    Shelby
    Participant

    Hi there Aris,

    I’m happy to help out here! 🙂

    While we typically don’t provide these kinds of customizations on the forums, it does seem to be a bit of an oversight on our part that it would order by end date, so I’ll see what I can do to help here.

    I’d suggest implementing the snippet found in this thread (also added below). Let me know how that goes and we’ll work from there! 🙂

    <?php $args = array( 'post_type' => 'tribe_events', 'posts_per_page' => 3 ); /* add our own filter to override what the event plugin. Using a priority of 99 makes it load after the even plugin has messed with things */ add_filter( 'pre_get_posts', 'use_our_own_damn_order_value', 99 ); function use_our_own_damn_order_value( $query ) { $query->set( 'orderby', 'meta_value' ); $query->set( 'meta_key', '_EventStartDate' ); $query->set( 'order', 'ASC' ); return $query; } $our_events = new WP_Query( $args ); ?> <?php while ( $our_events->have_posts() ) : $our_events->the_post(); ?>

    Best,

    Shelby 🙂

    #1311284
    adformation
    Participant

    Hi Shelby,

    Thanks for the snippet.
    I’m not sure where to put it though.
    The problem is in the shortcode – and no matter what I do, I can’t seem to make it work.

    // Retrieves the posts used in the List Widget loop.
    $posts = tribe_get_list_widget_events();

    As far as I can see – the snippet above, is what gets all the events, matching the filters in the shortcode (in this case, we use “category=”amu”). I’m a bit lost here.

    Best regards
    Aris Kuckovic

    #1314908
    Shelby
    Participant

    Hi Aris,

    You should put the snippet in your functions.php file. However, if you’re not comfortable making code changes, I’d highly suggest hiring a freelancer to help you out. We also have some guidance for making changes yourself in our Themer’s Guide here. Beyond this snippet, there is not a lot of support that we can offer for customizations such as this one, so a freelancer may be helpful to have in your back pocket anyway if this gets more complex. 🙂

    Cheers,

    Shelby 🙂

    #1325094
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. 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.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Order list by startdate’ is closed to new replies.