[tribe_events_list] / [display-posts] shortcode: how to show the last past event

Home Forums Calendar Products Events Calendar PRO [tribe_events_list] / [display-posts] shortcode: how to show the last past event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1085298
    Philippe
    Participant

    Hi,
    I pubish 1 event per week.
    I use the [display-posts] shortcode to show :
    – the next event : (the next week)
    [display-posts post_type=”tribe_events” taxonomy=”tribe_events_cat” tax_term=”dla_newsletter” title=”La prochaine” orderby=”date” order=”ASC” include_excerpt=”false” wrapper=”div” offset=”0″ posts_per_page=”1″]

    – and the 3 further events : (the 3 next week after the next week)
    [display-posts post_type=”tribe_events” taxonomy=”tribe_events_cat” tax_term=”dla_newsletter” title=”Les suivantes” orderby=”date” order=”ASC” include_excerpt=”false” wrapper=”li” offset=”1″ posts_per_page=”3″]

    I want to show the last past event (the last week)
    I try to use [tribe_events_list] or the [display-posts] shortcode with many parameters, but I can’t show the last past event.

    Thanks!
    Philippe.

    #1086136
    Josh
    Participant

    Hey Philippe,

    Thanks for reaching out to us!

    The simplest approach here would be to build a custom query using “tribe_get_events()” and setting the “eventDisplay” argument to “past”.

    You can then limit the output to just one event and set build the view however you would like.

    Thanks!

    #1086163
    Philippe
    Participant

    Hi Josh,
    thank for you answer, but I’m not a developer, and I have never use PHP 🙁
    It will be so simple, if I could use “-1” for the offset argument.
    Have you another trick to give me for non PHP fluent to solve my issue?

    Thanks,
    Philippe.

    #1086919
    Josh
    Participant

    Hey Philippe,

    Unfortunately I don’t believe there is a simpler way to approach or a built-in way using the list shortcode like that. You could try adding eventDisplay=”past” to see if the compiled arguments do impact the query. I don’t believe it will work, but if it does it would be the simplest approach outside of custom loop.

    Thanks!

    #1093490
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘[tribe_events_list] / [display-posts] shortcode: how to show the last past event’ is closed to new replies.