Loop outside of WP root
-
Hi,
Absolutely love the plugin Greg thank you.
I’m having some difficulty moving some custom loop template files outside of the theme root directory.
I’m trying to do this to keep the file structure tidy – as theres a few different loop layouts, and I’d prefer them in a template folder rather than the themes root.
I’m able to specify the location – and select the template via the backend/page builder… but just get an empty page if the template is anywhere but the root directory? Could you help me address this?
function get_loop_templates(){ $templates = array(); $files = glob(get_template_directory().'/loop-templates/*.php'); foreach($files as $file){ $templates[] = basename($file); }
shows in page builder – doesnt shwo in the front end
$files = glob(get_template_directory().'/loop-*.php');
shows in page builder and front end – but a bit messy when working with lots of custom loop layouts. Putting it into a folder would be a huge help.
Many thanks in advance if you are able to help with this!
https://www.ads-software.com/extend/plugins/siteorigin-panels/
- The topic ‘Loop outside of WP root’ is closed to new replies.