Home › Forums › Calendar Products › Events Calendar PRO › Show tagged events in event date order
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by
David.
-
AuthorPosts
-
June 22, 2017 at 7:10 am #1301678
David
ParticipantThis is a follow-on from the topic at https://theeventscalendar.com/support/forums/topic/show-tag-events-in-date-order/ since further investigation suggests that the response misunderstood my question.
We have a number of tagged events which we would like to share as a programme.
When these are displayed on the website — see http://ramsgatefestival.org/tag/ramsgate-reflections/ — they appear in reverse order of the event dates: the latest event appears first, the first event appears last.
The issue is not about publication date; it’s about event date. We would like the event on the earliest date to appear first and event on the latest date to appear last, as you would normally have in an event calendar.
Is there any way to do this, please?
June 23, 2017 at 4:10 pm #1302631Victor
MemberHi David!
Thanks for reaching out to us! Let me help you with that.
First off, I do want to note that we are fairly limited in how much we can support custom development questions like this. That said, I’d be happy to at least point you in the right direction as best I can.
You can change the order in which events show up in the tags archive page by customizing the query with the following code snippet:
add_action( 'pre_get_posts', 'custom_tag_order' ); function custom_tag_order($query) { if ( $query->is_main_query() && is_tag() ) { $query->set('orderby', 'meta_value'); $query->set('order', 'ASC'); $query->set('meta_key', '_eventStartDate'); return $query; } }You should place this code in your theme’s functions.php file and it will order your events by their start date, starting from the earliest.
I hope that helps! Let me know if you have other questions.
Best,
VictorJuly 15, 2017 at 9:35 am #1321741Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Show tagged events in event date order’ is closed to new replies.
