Skip to content

Instantly share code, notes, and snippets.

@stephenharris
Created September 11, 2013 19:01
Show Gist options
  • Save stephenharris/6528219 to your computer and use it in GitHub Desktop.
Save stephenharris/6528219 to your computer and use it in GitHub Desktop.
Register a template location with Event Organiser for your theme
<?php
/**
* Registers the directory "[child-theme-dir]/event-organiser" as a template location for
* Event Organiser. EO will look there when looking for the plug-in template files (e.g. single-event.php, archive-event.php, etc )
*
*/
function mytheme_register_eventorganiser_stack( $stacks ){
//$stacks is an array of (absolute) directory paths. EO will look in the order
//in which they appear in the array
//Add theme sub-directory to beginning of the array
array_unshift( $stacks, get_stylesheet_directory() . '/event-organiser' );
return $stacks;
}
add_filter( 'eventorganiser_template_stack', 'mytheme_register_eventorganiser_stack' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment