Display past events with most recent first

Home Forums Calendar Products Events Calendar PRO Display past events with most recent first

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1359162
    William Lee
    Participant

    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?

    #1360241
    Jennifer
    Keymaster

    Hi 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

    #1360303
    William Lee
    Participant

    Well, 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.

    #1360699
    Jennifer
    Keymaster

    Thanks 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

    #1360878
    Lindsey
    Participant

    I’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. πŸ™

    #1361023
    Jennifer
    Keymaster

    Hi 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

    #1364174
    William Lee
    Participant

    Jennifer, 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.

    #1365026
    Jennifer
    Keymaster

    Hi 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.

    #1365312
    William Lee
    Participant

    Well, 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?

    #1365319
    William Lee
    Participant

    Wait! I’m stupid. Ha! It’s only showing from August 2017 because I’m using the category “Current Auctions.” Okay…figured that part out.

    #1365729
    Jennifer
    Keymaster

    Hi 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.

    #1365855
    William Lee
    Participant

    Jennifer, 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.

    #1365923
    Jennifer
    Keymaster

    Excellent! 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!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Display past events with most recent first’ is closed to new replies.