Home › Forums › Calendar Products › Events Calendar PRO › Display past events with most recent first
- This topic has 12 replies, 3 voices, and was last updated 6 years, 6 months ago by Jennifer.
-
AuthorPosts
-
October 4, 2017 at 12:30 pm #1359162William LeeParticipant
I’ve searched the forums but can’t seem to find what I’m looking for. Is there a shortcode I can use to display past events on a page with the most recent events showing first?
October 6, 2017 at 6:31 am #1360241JenniferKeymasterHi William,
Thanks for reaching out! You can use the shortcodes that come with Pro to display events on any page you want, but they unfortunately don’t currently support sorting by date. However, I just tested this out, and the most recent events are showing first using [tribe_events view=”list”]. Are you getting different results, or are you trying to include past events as well?
Let me know if theΒ [tribe_events] shortcode works for you or if you have any other questions!
Thanks,
Jennifer
October 6, 2017 at 8:00 am #1360303William LeeParticipantWell, here’s the problem. We have events that are still active even though they’re technically in the past. But they won’t show up on the main events page without having to click “Previous Events” (or in our case, “Previous Auctions”). See screen shot.
October 7, 2017 at 1:03 am #1360699JenniferKeymasterThanks for clarifying! I think the simplest way would be to change the end date to be the date that you want the event to stop showing up on the events page, or you could also create an “active” category and assign that to auctions that are still active. Then, you can use a shortcode to display only these events. Would that work for you?
I’m not sure how else to include events that are still active without including all past events…we need to have a “marker” that we can use to only grab those past events that are still active. Does that make sense? If I’m misunderstanding what you’re looking for, please let me know!
Thanks,
Jennifer
October 7, 2017 at 8:57 pm #1360878LindseyParticipantI’m looking for the same… I’m needing to display past auctions on a page.
I have categories setup such as “upcoming auction” and “past auction” and I was trying out the ‘Event List’ Widget and have “past auctions” filtered but the widget it only displays UPCOMING events not past events. π
October 9, 2017 at 2:29 am #1361023JenniferKeymasterHi Lindsey,
If you use the “date” parameter with the full calendar view shortcodes, you can display events starting from a certain date, even in the past. You can also add a category parameter to limit the results to certain categories. While you can currently only add one category per shortcode, if you wanted to specify multiple categories you could do so by creating a parent category for the ones you want to display and then setting the parent in the shortcode.
I hope that helps! If you need further assistance with this, would you mind opening up a new thread and referencing this one? That will help us keep things organized and provide more personalized support!
Thanks,
Jennifer
October 16, 2017 at 8:37 am #1364174William LeeParticipantJennifer, the category option doesn’t solve the problem. I have all active auctions in a category called “Current Auctions,” but when I try to show that category, it still only shows the ones whose end dates are in the future. Technically an auction may end but still be active. All I’m really looking for is a way to display all events without having to cut them off via date. Just display all events from the current date backwards without a “Β« Previous Auctions” pagination.
October 17, 2017 at 5:18 pm #1365026JenniferKeymasterHi William,
Can you try using this shortcode:
[tribe_events date="2016-01" category="current-auctions" view="list"]
You can replace “current-auctions” with your category slug, and the date with the farthest date back that you would like events to show from.
I just tested this out on my end, and it should show all events in that category starting from January 2016 up until the current date, with the oldest ones first. If you want to change the sort order, you would need to do a bit of a customization…I’d recommend taking a look at this post as a starting point, as well as our themer’s guide. We are limited in the amount of support that we can provide for customizations, but if you have questions or get stuck, please let me know and I’ll be happy to point you in the right direction!
I’m sorry I don’t have a more straightforward solution for you here, but if you would like to see this added as a feature in an upcoming release, please do let us know over in our Feature Ideas Forum! This is what we use to gauge user interest in new features and help guide future development efforts.
October 18, 2017 at 7:06 am #1365312William LeeParticipantWell, it’s a little closer. π The short code you provided gave me more events on a page, but no matter what date I choose, it only shows August 2017 through the present. I can’t get it to show anything prior to August. Additionally, the code snippet didn’t change anything.
I realize I’m using the calendar in a very specific way, so I understand if there’s not a lot you can do to help me customize this. I definitely think it would make sense though to include a simple option to display events in a particular order. I’ll post that in the suggestions. For now though, any chance you can point me in a better direction?
October 18, 2017 at 7:14 am #1365319William LeeParticipantWait! I’m stupid. Ha! It’s only showing from August 2017 because I’m using the category “Current Auctions.” Okay…figured that part out.
October 18, 2017 at 4:14 pm #1365729JenniferKeymasterHi William,
I’m glad you were able to get the date part figured out!
Regarding the order, the code snippet is actually for past event views, I just meant it to be an example to get you started – sorry I should have been clearer on that! I did a quick test though, and a I think something like this may get this working for you:
function tribe_past_reverse_chronological ( $post_object ) {
if ( is_page( '1095' ) ) {
$post_object = array_reverse( $post_object );
}return $post_object;
}
add_filter ( 'the_posts', 'tribe_past_reverse_chronological', 999 );You can replace the argument in the is_page function with the slug or ID for the page you’re displaying the shortcode on. Let me know if you have any questions on this.
Thanks for posting the request! That really is helpful for is in getting a better understanding of what our users are missing from our products.
October 19, 2017 at 5:28 am #1365855William LeeParticipantJennifer, you’re a genius! That’s exactly what I needed. I removed the page ID so it would apply to all pages. Worked like a charm! π
Thanks so much for your help.
October 19, 2017 at 7:16 am #1365923JenniferKeymasterExcellent! I’m glad to hear you were able to get it working how you wanted. Β π
I’ll go ahead and close out this thread, but please feel free to open up a new one if you have any other questions!
-
AuthorPosts
- The topic ‘Display past events with most recent first’ is closed to new replies.