Home › Forums › Calendar Products › Community Events › Order Events by last modified date
- This topic has 5 replies, 2 voices, and was last updated 11 years, 6 months ago by
Geoff.
-
AuthorPosts
-
October 21, 2014 at 12:12 pm #825083
artencite
ParticipantHello, I have now an hundred events in my website and in my dashboard, I would like to sort them by last modified date (or date of modification ?) But in the screen option, there are only available : date of start and date of end. How can I sort/order my events by last modified date ? Kind Regards (Note : I am not an experienced webmaster )
October 21, 2014 at 5:42 pm #825708Geoff
MemberHi there, Aurélien!
The easiest way to do this is probably to override the template you are using for your calendar view (looks like List view is being used on your site right now) and create a custom query that orders the events by modified date.
You can use the default WordPress get_posts() function to do something like this:
<?php $args = array( 'posts_per_page' => 10, 'orderby' => 'modified', 'order' => 'DESC', 'post_type' => 'tribe_events', 'post_status' => 'publish', ?>You’ll likely want to modify that to fit your needs, but it should point you in the right direction. i’d also recommend checkout out our Themer’s Guide for more information on template overrides, if you’re new to them.
Does this help answer your question? Please let me know. 🙂
Cheers!
GeoffOctober 22, 2014 at 2:04 pm #827702artencite
ParticipantIt’s very kind to answer so fast, but i am very newbie in editing. I spent 1 hour trying to understand your answer, but i still don’t understantd. Which file do i need to edit ? Where is it ? Do I need to create a new file ? where ?
October 22, 2014 at 2:08 pm #827710artencite
Participantprecision : I use pinboard theme
October 22, 2014 at 6:36 pm #828191Geoff
MemberHi there, Aurélien! Thanks for following up and my apologies if my answer wasn’t very clear.
Try adding this snippet to your theme’s functions.php file. It will probably be a little easier than doing a template override.
This may or may not work with your specific theme and would need to be modified from there. While that sort of customization is beyond the scope of what I can provide here in the forums, this should get you started in the right direction. 🙂
I hope this helps!
Cheers!
GeoffOctober 30, 2014 at 8:48 am #849825Geoff
MemberHey there, Aurélien! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new a new thread and we’d be happy to help you out. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘Order Events by last modified date’ is closed to new replies.
