Home › Forums › Calendar Products › Events Calendar PRO › Order related events
- This topic has 7 replies, 2 voices, and was last updated 8 years, 11 months ago by
nmafa.
-
AuthorPosts
-
May 2, 2017 at 10:34 am #1277529
nmafa
ParticipantHello,
On event pages I see the three ‘related events’ as they should be but for some reason they order themselves randomly and what we need is for all related events on event pages to order chronologically.
Example (now):
Event May 22 — Event March 11 — Event January 22What we need is:
Event January 22 — Event March 11 — Event May 22Thank you
May 3, 2017 at 7:41 am #1277982nmafa
ParticipantHere is a screenshot of my problem. I appreciate any help.
May 3, 2017 at 6:23 pm #1278332Victor
MemberHi Michael!
Thanks for reaching out to us!
The related events show randomly by default, so that is the expected behaviour.
If you want to change the order in which they appear then you should check the code that Cliff put up in the following thread > https://theeventscalendar.com/support/forums/topic/order-related-events/
I hope it helps 🙂
Best,
VictorMay 10, 2017 at 8:13 am #1281669nmafa
ParticipantCliff,
thank you for your response. Unfortunately, the code above is not on the page it says it should be (general.php). I am in no way a php programmer so had the example code you linked to been relevant I’m not sure if I would have been able to figure it out anyways.
Is there another approach we can try? This is a feature request and is one I agree with. Why would your company default to random when people generally look at things chronologically? Either way, I’m hoping that I can get an answer that doesn’t assume my skill level. We are a customer of a few of your products so I hope that we can solve this together.
Thanks in advance
MikeMay 10, 2017 at 9:36 am #1281794Victor
MemberHi Mike!
I’m sorry I didn’t give you more details on how to achieve that. That was something to point you in the direction of customizing the order of related events.
Just to set expectations right, we are fairly limited in how much support we can give for customizations like that.
That said, we are always happy to help and at least point you in the right directions. So let me try and help you with this.
I’ve put up a simple code to order the related events by their start date. You should copy and paste the following snippet of code into your theme’s functions.php file:
https://gist.github.com/vicskf/6c549b4604614b078f1080c14bd79f39
Remember not to copy the ‘<?php’ opening tag.
Does it do the trick? Let me know about it 🙂
Cheers!
VictorMay 10, 2017 at 10:57 am #1281855nmafa
ParticipantVictor,
YES! It did the trick. Thank you, I am most appreciative.
Mike
May 10, 2017 at 11:14 am #1281869Victor
MemberHey Mike!
I’m glad that worked out for you! Thanks for letting me know about it.
I’ll close this thread as you marked it as resolved, but feel free to open a new one when needed.
Good luck with your project!
Victor -
AuthorPosts
- The topic ‘Order related events’ is closed to new replies.
