Created
September 11, 2013 19:01
-
-
Save stephenharris/6528219 to your computer and use it in GitHub Desktop.
Register a template location with Event Organiser for your theme
This file contains 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 | |
/** | |
* 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