Last active
May 17, 2019 13:21
-
-
Save sadikyalcin/c0e6500e99f7a7509faa7e3c0438df1a to your computer and use it in GitHub Desktop.
A working alternate to eventbrite single view
This file contains hidden or 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 | |
/** | |
* 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