• I will be managing several WordPress installations all using the same template.

    All my band friends want a “community” of blogs (on different domains with separate wp installations) all using the same theme.

    I will need to be able to alter the themes without accessing each account.

    I have succeeded in part however……..

    I am trying to create a template file that will get_categories or whatever function I need. (query wp)

    No problem within the WordPress installation but, I need to host the templates remotely.

    I do not have remote file url access so I cannot include a file from a different url / server.

    I do use curl_get_contents via calling a small script in the header.
    So, I can serve up all the template html, php and javascript remotely no problem. Just no wp functions.

    I would like to be able to include the whole template file instead of multiple “snippets” of each template file via curl_get_contents inserted around each instance of the WordPress query/call function code.

    No, I have no problem using a file that resides on each wp-install that calls wp-config and wp-db.php to access the database. I can even put it before the public root in the abs path(/home/somesite/wp/).

    Envisioning a file that resides on each installation that acts as a main “function” file for all the templates (Not the template function.php, that needs to be in there too!).

    So, I can include/require that file from below the root directory on each wp installation.

    Ideally, I could require the file once in the header.php and it would take care of the entire template.

    Or, I could call each template file via a function like get_single_template() in the existing single.php template file.

    I have learned so much about WordPress in the last few days and knowing how to do this would really help. I searched and searched for a whole day trying to find an answer to no avail.

    I have found some “remote posting” code snippets and methods of calling/viewing a post on another domain but, over my head on modding them.

    Almost seems to me as if I would be calling wp as a plug in would.

    The tdo forms plug in contains the framework for what I want to do but, I don’t need all that code and do not want to use a plug in.

    I think I am making a mountain from a mole hill again. There is prob a one liner that will do it. All my hours of research and I can’t figure it out but, someone out there knows it off the top of their head! Wish I had a head like that!

    Thanks in advance for any help!

Viewing 1 replies (of 1 total)
  • Thread Starter zentode

    (@zentode)

    Still struggling while learning the wp codex.

    What I have done for now is this.

    I keep the latest template files on a remote server.

    Then, in the header.php, I require once a local file that grabs a template revision number from the remote server and saves it in a var.

    If the rev returned is greater than the current installation, it executes a small PERL (faster) routine that copies the latest template file(s) to the WordPress installation adding a rev extension (single2a.php). Then, it renames the new file by dropping the rev.

    That worked so, I decided to make it more error resistant.

    There are many ways to address access issues during the rename process but, a rename takes less time than an open file, write, set perms etc.. Could do many things here like if the rev is out of date, copy the existing to a local temp folder and pull from that while the new file is installed. Or, have a live version AND a copy of the live version in a temp folder. If rev is out of date, it pulls from the temp folder and prompts an update. On update completion, the last routine updates the rev which then tells the header function it is ok to use the “normally located” templates then, updates the secondary temp sets.

    Very crude approach but, works for now and seemingly un-obtrusive to the viewer. Shows my horribly limited knowledge of the wp codex.

    I have seen, in the admin themes area, templates that indicate when there is a newer version available. I have not researched how that works but, I think a variation/inclusion of that routine may work in my case if the template update was automatic and all the possible issues were addressed by that function.

    Still looking for the best solution though!

Viewing 1 replies (of 1 total)
  • The topic ‘“Remote” template file that can call a function?’ is closed to new replies.