Showing all events past and upcoming on one page

Home Forums Welcome! Pre-Sales Questions Showing all events past and upcoming on one page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1146111
    TJ
    Guest

    Hi 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,
    TJ

    #1146220
    Geoff
    Member

    Hi 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!
    Geoff

    #1146567
    TJ
    Guest

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

    #1146577
    Geoff
    Member

    Hi 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!
    Geoff

    #1149952
    Geoff
    Member

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Showing all events past and upcoming on one page’ is closed to new replies.