Support » Fixing WordPress » Load WordPress theme templates in non-WordPress folder/site

  • Resolved Pioneer Web Design

    (@swansonphotos)


    Scenario:

    Customer has procured a PHP application. This is installed and runs in root/folder. All is well with that (now). WP is installed in root.

    What I am trying to do is load a few WordPress templates, or include them, but keep getting errors…file not found in xxx.php on line xxx...so the sub-folder/app is not finding the WordPress files.

    <?php include 'folder/file.php'; ?>

    The file/folder structure is:

    root
    -app_folder
    -wp-content
    –themes
    —mytheme
    —mychildtheme

    I am trying to pull, for example, (child theme) header.php and (child theme) footer.php into the app_folder’s index.php

    I have tried a myriad of things to get this to work…I have tested all the templates, they work, I can echo and display content where desired in the ‘app’ and in wordpress child theme….

    What have I missed here?

    Note, the app is hard coded in hundreds if not more places with relative url’s, so I have to keep it at root/app_folder or it fails.

    I thought about setting a base url but even that failed…again, perhaps I missed something?

Viewing 1 replies (of 1 total)
  • Thread Starter Pioneer Web Design

    (@swansonphotos)

    This is resolved. Must I reveal how? OK, I will! I needed to use require absolute path in this (Smarty based) application:

    <?php require 'absolute_path_to_WP_root/wp-load.php'; ?>

    And then call get_header(); etc. as required in specific app files.

Viewing 1 replies (of 1 total)
  • The topic ‘Load WordPress theme templates in non-WordPress folder/site’ is closed to new replies.