Home › Forums › Welcome! › Pre-Sales Questions › Showing all events past and upcoming on one page
- This topic has 4 replies, 1 voice, and was last updated 9 years, 9 months ago by
Geoff.
-
AuthorPosts
-
August 1, 2016 at 8:32 am #1146111
TJ
GuestHi there,
With this PRO version is there a way to tick to show ALL events on one page rather than them by default being separated by upcoming and past? It’s just when a site doesn’t have loads of events, or sometimes none, it would be good to just see the previous ones too.
Many thanks,
TJAugust 1, 2016 at 11:51 am #1146220Geoff
MemberHi TJ — thanks for getting in touch!
You can actually use theย tribe_get_events() function in the free version to create a custom query of events in a template os that both past and upcoming events display on a single page. Events Calendar PRO does not have a specific setting to do that, but you can certainly create that list of events using the function.
In fact, we have a nice tutorial available on how to use the function with some specific examples.
Will that work for you? Please let me know. ๐
Cheers!
GeoffAugust 2, 2016 at 9:10 am #1146567TJ
GuestHi Geoff,
Thanks so much for your help!! Much appreciated, this sounds perfect.
Please may I check how would I just implement this into your existing loop code, ie below, as I’m totally happy with how it all works and looks, apart from I want all events to show ๐
<?php /** * List View Loop * This file sets up the structure for the list loop * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php * * @package TribeEventsCalendar * */ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } ?> <?php global $post; global $more; $more = false; ?> <div class="tribe-events-loop"> <?php while ( have_posts() ) : the_post(); ?> <?php do_action( 'tribe_events_inside_before_loop' ); ?> <!-- Month / Year Headers --> <?php tribe_events_list_the_date_headers(); ?> <!-- Event --> <?php $post_parent = ''; if ( $post->post_parent ) { $post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"'; } ?> <div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?> fade_me_in" <?php echo $post_parent; ?>> <?php tribe_get_template_part( 'list/single', 'event' ) ?> </div> <?php do_action( 'tribe_events_inside_after_loop' ); ?> <?php endwhile; ?> </div><!-- .tribe-events-loop -->Thanks so much!!
August 2, 2016 at 9:34 am #1146577Geoff
MemberHi TJ,
I’m afraid it will take a bit more custom development to edit the List View template itself than we are able to support here in the Pre-Sales forum.
I did find this GitHub repo and, while I did not test it personally, perhaps it will at least help get you started in the right direction.
Did you have any questions about purchasing any of our premium plugins? If so, please let me know and I’d be happy to help.
Cheers!
GeoffAugust 10, 2016 at 7:40 am #1149952Geoff
MemberHey TJ, I see my last reply was marked as the correct answer.ย I’ll go ahead and close this thread but please feel free to let us know if any other questions pop up and we’d be happy to help. ๐
Cheers and have a great day!
Geoff -
AuthorPosts
- The topic ‘Showing all events past and upcoming on one page’ is closed to new replies.
