Home › Forums › Calendar Products › Events Calendar PRO › Query upcoming events
- This topic has 7 replies, 2 voices, and was last updated 7 years, 8 months ago by
wacreading.
-
AuthorPosts
-
August 24, 2018 at 10:18 am #1605251
wacreading
ParticipantI 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,
MikeAugust 24, 2018 at 10:20 am #1605252wacreading
ParticipantI tried editing for formatting a couple times, but… hopefully you can see what I’m saying.
August 24, 2018 at 10:21 am #1605253wacreading
Participant$args = array( ‘post_type’ => ‘tribe_events’,
‘post_status’ => ‘publish’,
‘orderby’ => ‘post_date’,
‘order’ => ‘ASC’
);
$events= new WP_Query($args);August 27, 2018 at 4:29 pm #1607113Cliff
MemberHi. 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.
August 27, 2018 at 5:11 pm #1607141wacreading
ParticipantI’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?
August 27, 2018 at 8:17 pm #1607185Cliff
MemberEvents 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?
- Downloads / Version Numbers
- License Keys
- TEC Automatic Updates
- or TEC Manual Updates
- WordPress core updates
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.
August 28, 2018 at 3:44 am #1607369wacreading
ParticipantIt 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.
August 28, 2018 at 10:09 pm #1608410Cliff
MemberI don’t think I’ve heard of that one before…
Glad to hear and thanks for letting us know.
-
AuthorPosts
- The topic ‘Query upcoming events’ is closed to new replies.
