Skip to content

Instantly share code, notes, and snippets.

View sadikyalcin's full-sized avatar

Abdul Sadık Yalçın sadikyalcin

View GitHub Profile
@sadikyalcin
sadikyalcin / events-index.php
Created May 17, 2019 13:30
The index template for displaying eventbrite events via eventbrite API plugin
<?php
/**
* Template Name: Eventbrite Theme Template
*
* The template used for displaying all events
*
* @package New West End
*/
get_header(); ?>
@sadikyalcin
sadikyalcin / functions.php
Created May 17, 2019 13:23
Register custom query vars and template hierarchy re-write to load a specific template for a post type
function prefix_register_query_var( $vars ) {
$vars[] = 'eb_id';
$vars[] = 'eb_t';
return $vars;
}
add_filter( 'query_vars', 'prefix_register_query_var' );
function prefix_url_rewrite_templates() {
if ( get_query_var( 'eb_id' ) ) {
@sadikyalcin
sadikyalcin / events-single.php
Last active May 17, 2019 13:21
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(); ?>