Create a gist now

Instantly share code, notes, and snippets.

A page template that lists venues with Event Organiser
* Template Name: Venue Archive
* Description: A page template that lists venues with Event Organiser. Just a simple example of what
* you can do.
* @link Related Tutorial
* You can add this to your theme and then create a page, selecting it as the page template. The 'content' you enter is ignored, but you could edit this to include that too.
get_header(); ?>
<div id="primary">
<div id="content" role="main">
$venues = eo_get_venues();
if( $venues ):
foreach( $venues as $venue ):
//IMPORTANT: Make sure venue ID is an integer (If its a string, it will be interpreted as a slug).
$venue_id = (int) $venue->term_id;
printf('<article id="venue-%d">', $venue_id );
/* Display venue name and address */
echo '<header class="entry-header">';
printf('<h1> %s </h1>', eo_get_venue_name($venue_id) );
$address = array_filter(eo_get_venue_address($venue_id));
echo implode(', ',$address);
echo '</header>';
/* Display venue description & map */
echo '<div class="entry-content">';
echo eo_get_venue_description($venue_id);
echo eo_get_venue_map($venue_id);
/* Display next 5 events */
$events = eo_get_events(array(
if( $events ){
echo '<h2> Next 5 events </h2>';
echo '<ul>';
foreach ($events as $event ){
printf('<li> %s on %s </li>', get_the_title($event->ID), eo_get_the_start('jS F Y', $event->ID,null,$event->occurrence_id));
echo '</ul>';
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>

this was really useful to me, but I have two questions:
1. How can I make this page template have the right sidebar and venues layout in two columns?
2. how can I make the title of the next 5 events linked to the event itself?
Thank you


I've worked out how to make point 1 still cant figure out point 2. any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment