Home › Forums › Calendar Products › Events Calendar PRO › Display past events on organizer's and venue's pages
- This topic has 8 replies, 2 voices, and was last updated 6 years, 9 months ago by Leander Wattig.
-
AuthorPosts
-
July 31, 2017 at 9:17 am #1328370Leander WattigParticipant
Hi everybody,
I’m a strong user of The Events Calendar and I’m already above 1,000 events in the database this year. Naturally, most pages of venues and organizers are empty since currently there are no upcoming events. Therefore, I’d like to show the past events there to show what good they have done (and will do).
How do I accomplish that?
Thanks and best,
LeanderAugust 2, 2017 at 2:34 pm #1329757VictorKeymasterHello Leander!
I’d be happy to help you with that.
You could achieve something like that by customizing the single-venue.php and single-organizer.php files located at /wp-content/plugins/events-calendar-pro/src/views/pro/
You could make a template override of those templates by following the steps provided in our themer’s guide > https://theeventscalendar.com/knowledgebase/themers-guide/
I hope it helps! Let me know if you have other questions.
Best,
VictorAugust 3, 2017 at 2:30 am #1329930Leander WattigParticipantHi Victor,
Thanks! Do you maybe have the line of code which I can use there then to get the past events into the venue’s and locations’ pages via template override?
Thanks and best,
LeanderAugust 3, 2017 at 9:56 pm #1330552VictorKeymasterHey Leander!
I’ve just taken a look at both templates and they seem to be different customizations for each of them. I’m not sure how hard this would be, but I will have to dig a little deeper to come up with a working code.
While we cannot help with custom coding, I will try to get something working here, but we’re busy at the moment so it may take me until tomorrow or beyond.
I hope you can understand and your patience would be highly appreciated 🙂
Thanks,
VictorAugust 4, 2017 at 1:11 am #1330586Leander WattigParticipantHi Victor,
I fully understand that you can’t provide custom coding but a hint into the structure would be great. I’m not a coder but tried to look into it and have no idea how to get past events out of the system at all. I found an old forum’s posting concerning that but the code seems to have changed.
(https://theeventscalendar.com/support/forums/topic/upcoming-and-past-events-on-single-venue-page/ &
https://theeventscalendar.com/support/forums/topic/display-past-events-on-organizers-page/)Thanks so much
Leander- This reply was modified 6 years, 9 months ago by Leander Wattig.
August 7, 2017 at 6:23 am #1331511VictorKeymasterHello Leander!
Using the linked threads I managed to come up with some working snippets.
Try the following code in your single-venue.php template override:
// First show upcoming events echo tribe_venue_upcoming_events( $venue_id, $wp_query->query_vars ); // and then those from the past echo tribe_include_view_list( array( 'venue' => $venue_id, 'eventDisplay' => 'past' ) );
The next one is for the single-organizer.php template file:
echo tribe_organizer_upcoming_events( $organizer_id ); // Past events echo tribe_include_view_list( array( 'organizer' => $organizer_id, 'eventDisplay' => 'past' ) );
Let me know if that works for you 🙂
Best,
VictorAugust 8, 2017 at 1:45 pm #1332441Leander WattigParticipantHi Victor,
Thank you so much – this works great. I adjusted it a little further and have it integrated now on orbanism.com which is cool because now there aren’t most venue and event organizer pages empty anymore. We curate the event picks so it’s even interesting afterwards.
Thanks and best,
LeanderAugust 8, 2017 at 9:18 pm #1332592VictorKeymasterHey Leander!
I’m super glad it worked out for you that way! Thanks for following up to let us know about it.
I’ll close this now, but feel free to open a new topic if anything comes up and I’d be happy to help 🙂
Cheers!
Victor -
AuthorPosts
- The topic ‘Display past events on organizer's and venue's pages’ is closed to new replies.