Query upcoming events

Home Forums Calendar Products Events Calendar PRO Query upcoming events

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1605251
    wacreading
    Participant

    I believe this was working, but seems to have stopped recently.

    We have a custom slider on our homepage that is supposed to show the 10 upcoming events.’

    We populate it with the query:

    	$args = array( 'post_type' => 'tribe_events',
    

    ‘post_status’ => ‘publish’,

    					'orderby' => 'post_date',
    

    ‘order’ => ‘ASC’

    				 );
    

    $events= new WP_Query($args);

    I am getting my results out of order now. I tried using EventStartDate and _EventStartDate as the orderby value with no change.

    Any tips?

    Thanks,
    Mike

    #1605252
    wacreading
    Participant

    I tried editing for formatting a couple times, but… hopefully you can see what I’m saying.

    #1605253
    wacreading
    Participant

    $args = array( ‘post_type’ => ‘tribe_events’,
    ‘post_status’ => ‘publish’,
    ‘orderby’ => ‘post_date’,
    ‘order’ => ‘ASC’
    );
    $events= new WP_Query($args);

    #1607113
    Cliff
    Member

    Hi. Instead of using new WP_Query, please use tribe_get_events() instead: https://theeventscalendar.com/knowledgebase/using-tribe_get_events/

    Please let me know how this goes for you.

    #1607141
    wacreading
    Participant

    I’ll try that for our custom slider, but what about on the built in page /events. The events there are no longer listed in chronological order by start date. How do I reset the event order there?

    #1607185
    Cliff
    Member

    Events displaying out of order isn’t currently a known issue so it could be that your theme or another plugin is affecting things. I’d suggest following these recommended troubleshooting steps for your own site:

    There might be some new updates available. Could you please make sure all your Modern Tribe plugins (and WordPress core) are at their latest versions?

    Once you verify you’re on the latest versions, please test to see if the issue is still happening for you.

    You might also see if you can spot any console errors at your site. (If needed, you may reference our KB article Using Google Chrome Developer Tools.)

    Whenever troubleshooting, it’s best to edit your wp-config.php file to enable WP_DEBUG and WP_DEBUG_LOG (which will create a file on your server at /wp-content/debug.log if there are any WP_DEBUG messages) and share any debug messages you see while trying to replicate this issue and doing other things on your site relevant to this ticket (such as visiting your site’s home page, events page, single-event pages, and anything else you can think to do).

    If there’s nothing obvious (such as a console error or WP_DEBUG message) pointing you to what might be the problem, please follow our Testing for Conflicts Guide (basically switch to Twenty Seventeen theme and deactivate all plugins and custom code other than Modern Tribe plugins) and see if that helps narrow down the cause of this.

    Note that https://wordpress.org/plugins/plugin-detective/ may prove helpful as well. (third-party, not guaranteed or supported by us)

    Of course, we always recommend restorable database and file backups as well as performing modifications first on a staging site before modifying anything on your live/production site.

    If you still need assistance with this, please share your System Information (while in Testing for Conflicts Mode) in a Private Reply.

    That will give me a lot of extra information to help troubleshoot this.

    Let us know what you find out.

    Thanks.

    #1607369
    wacreading
    Participant

    It turns out the problem was related to the Event – Re-Order menu.

    I’m not sure if that’s core functionality of Tribe Events, or a third-party plugin. Either way, it was the problem and I got it resolved.

    Thanks.

    #1608410
    Cliff
    Member

    I don’t think I’ve heard of that one before…

    Glad to hear and thanks for letting us know.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Query upcoming events’ is closed to new replies.