Skip to content

Instantly share code, notes, and snippets.

@sadikyalcin
Last active May 17, 2019 13:21
Show Gist options
  • Save sadikyalcin/c0e6500e99f7a7509faa7e3c0438df1a to your computer and use it in GitHub Desktop.
Save sadikyalcin/c0e6500e99f7a7509faa7e3c0438df1a to your computer and use it in GitHub Desktop.
A working alternate to eventbrite single view
<?php
/**
* The Template for displaying all single Eventbrite events.
*
* This is nearly an exact copy of the default single view from the Eventbrite API plugin.
* @param string eb_id - The ID of the event
*/
get_header(); ?>
<!-- Adjust markup as required -->
<?php
// Get our event based on the ID passed by query variable.
$event = new Eventbrite_Query( array( 'p' => get_query_var( 'eb_id' ) ) );
if ( $event->have_posts() ) :
while ( $event->have_posts() ) : $event->the_post(); ?>
<!-- Use the helper functions here to print your data: https://github.com/Automattic/eventbrite-api#functions -->
<?php endwhile; ?>
<?php else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
// Return $post to its rightful owner.
wp_reset_postdata();
?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment