I am working on a site that is using Oxygenbuilder, which does not use a theme, so there is no theme folder. Woocommerce has a method that allows us to set the path location(see link). Is it possible to do something similar with Event Espresso?
EE runs the template through EEH_Template::locate_template() to find locations of custom templates, that method has a few filters within it to do what you are looking for.
For example you can use FHEE__EEH_Template__locate_template__template_folder_paths to hook in and filter the directories EE will check for custom templates.
Or there is also FHEE__EEH_Template__locate_template__full_template_paths which filters the full path for a template before it is displayed, again that can also do the above.
(Note the above is using the theme {theme}/espresso/ rather than just the themes root directory but the method is the same you just use whichever path you prefer)
However, not that EE already checks multiple locations for template files, it checks (in this order) these directories:
* <server path up to>/wp-content/themes/<current active WordPress theme>/
* <assumed full absolute server path>
* <server path up to>/wp-content/uploads/espresso/templates/<current EE theme>/
* <server path up to>/wp-content/uploads/espresso/templates/
* <server path up to>/wp-content/plugins/<EE4 folder>/public/<current EE theme>/
* <server path up to>/wp-content/plugins/<EE4 folder>/core/templates/<current EE theme>/
* <server path up to>/wp-content/plugins/<EE4 folder>/
So you could use /wp-content/uploads/espresso/templates/ to load your templates from. We deprecated usage of those directories a while back due to some security plugins scanning /wp-content/uploads for .php files and either deleting them or emptying the content of the file and leaving it in place (which is worse than deleting it!).
Viewing 1 reply thread
The support post ‘Setting override template location’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.