Page Builder by SiteOrigin
[resolved] Loop outside of WP root (4 posts)

  1. mak1wp
    Posted 3 years ago #


    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!


  2. Greg Priday
    Plugin Author

    Posted 3 years ago #

    Good call @mak1wp! I'm working on this right now. It should be ready for the next version, but I'll keep you updated.

  3. Greg Priday
    Plugin Author

    Posted 3 years ago #

    I have this working in my development version now. I just need to do some testing, but I should be releasing an update early next week.

    Thanks for the great idea! Please keep them coming :)

  4. mak1wp
    Posted 3 years ago #

    Hey! Awesome! :D

    Great work Greg, look forward to seeing how you've done it. Glad you like the idea.

    The purpose behind it was (other than to keep everything tidy) -

    I've duplicated the loop widget/function - modified it a little bit and limited it to a specific post type, in this instance, a custom portfolio post type I've created.

    I've done this as I've included a filterable isotope option, which pulls in the category filter functions, and works slightly differently to the standard loop templates.

    Thanks again for the help and quick reply!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Page Builder by SiteOrigin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic