Last active
August 29, 2015 14:04
-
-
Save joshfeck/1fd543d0494bde1629cf to your computer and use it in GitHub Desktop.
Example event archive loop that displays events in an html table. You can adapt this into your WP theme by copying its archive.php file into your child theme, rename it to archive-espresso_events.php. Then replace the standard loop with the following code example. Requires Event Espresso 4.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : ?> | |
<table class="events"> | |
<thead> | |
<tr> | |
<th>Event</th> | |
<th>Tickets available</th> | |
<th>Starts</th> | |
<tr> | |
</thead> | |
<tbody> | |
<?php /* Start the Loop */ ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<tr> | |
<td class="event_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td> | |
<td class="tickets"><?php espresso_event_tickets_available() ?></td> | |
<td class="start_date"><?php echo date(get_option('date_format'). ' '.get_option('time_format'), strtotime($post->DTT_EVT_start)) ?></td> | |
</tr> | |
<?php endwhile; ?> | |
</tbody> | |
</table> | |
<?php else : ?> | |
<?php echo 'No upcoming events'; ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment