Hi Stephen,
is there a way to put the event-organiser template files in a subfolder? At the moment, they are making a bit of a mess in my theme-folder. It would be great to put them in a subfolder called ‘event-organiser’.
Thanks for your help!
Best regards
Martin
-
This topic was modified 9 years, 4 months ago by
Martin Schuff.
-
This topic was modified 9 years, 4 months ago by
Martin Schuff.

Martin Schuff
Yes you can register additional template locations:
function mytheme_register_subfolder_for_stack( $stack ){
$template_dir = get_stylesheet_directory(); //child theme
$parent_template_dir = get_template_directory(); //parent theme
//prepend /event-organiser subdirectory of child & parent theme
//The locations get checked in order.
array_unshift(
$stack,
$template_dir . "/event-organiser",
$parent_template_dir . "/event-organiser"
);
return $stack;
}
add_filter( 'eventorganiser_template_stack', 'mytheme_register_subfolder_for_stack' );
The above puts the /event-organiser
subdirectory of the child and parent theme (even if there is no child theme you can keep that there) at the beginning of the template stack – so the plug-in will look for the template file there first.
You can also remove locations in the unlikely event that there are naming conflicts.

Stephen Harris
Thanks Stephen! It works fine! Only single-event.php has to stay in the root of the theme. But I guess that’s wordpress specific.
-
This reply was modified 9 years, 4 months ago by
Martin Schuff.

Martin Schuff
That’s true, the single-event.php
is handled differently because if it’s not present in the theme it reverts to single.php
.

Stephen Harris