Our Virtual Events plugin gives you the option to show livestream links (Zoom, webinar, etc.) on the event page. The content of the page is visible from the time of publishing or from the start of the event until the ends of time.

If you would rather have that part of the content disappear after the event is over, that’s also possible. You need a tiny template override for it.

👋 A template override is basically taking one of the files of our plugins responsible for showing content on the front end, making a copy of it in a specific folder, and making modifications to that copied file. These files can be found in the src/views folder of our plugins.

In this example, you will see how to hide the content of a Zoom call after the event has passed.

You will need to create a template override for this file:

wp-content/plugins/events-virtual/src/views/zoom/single/zoom-details.php

Take that file and make a copy of it here:

wp-content/themes/[your-child-theme]/tribe/events-virtual/zoom/single/zoom-details.php

Open up the file for editing, and right before the HTML code starts – before the first <div – add this line:

<?php if ( ! tribe_is_past_event() ) : ?>

The beginning of the file should look something like this now. (Note, the line numbers are approximate.)

// Remove the query vars from the zoom URL to avoid too long a URL in display.
if ( ! empty( $event->zoom_join_url ) ) {
	$short_zoom_url = implode(
		'',
		array_intersect_key( wp_parse_url( $event->zoom_join_url ), array_flip( [ 'host', 'path' ] ) )
	);
}
?>
<?php if ( ! tribe_is_past_event() ) : ?>
<div class="tribe-events-virtual-single-zoom-details tribe-events-single-section tribe-events-event-meta tribe-clearfix">

Now at the very end, after the last </div> in the file add this:

<?php endif; ?>

So the end of the file should look something like this:

				</ul>
			</div>
		</div>
	<?php endif; ?>
</div>
<?php endif; ?>

Save the changes to the file and you should be set.

If you would like to achieve something similar with your embedded video content, then you will need a template override for this file:

wp-content/plugins/events-virtual/src/views/single/video-embed.php

The file for the “Watch” button would be this one:

wp-content/plugins/events-virtual/src/views/components/link-button.php