WordPress.org

Support

Support » Themes and Templates » Sub Directories Within WP 1.5

Sub Directories Within WP 1.5

  • I am trying to use WP 1.5 themeing and templating to skin static files outside the WP directory. I have searched the Support Forum, Codex and completed a Google Search for a solution. As far as I can tell this is not possible. Please tell me it isn’t true!

Viewing 6 replies - 1 through 6 (of 6 total)
  • If a file is PHP-based (i.e. something.php), you should be able to “theme it” by adding this to the very top of the document:

    <?php
    define('WP_USE_THEMES', true);
    require('./blog/wp-blog-header.php');
    ?>

    The path to wp-blog-header.php is an example; make sure it points to the correct location.

    From there you can use the “include” tags for any templates you need to add from the active theme:

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Do these files and sub directories occur from the root of the WordPress installation or within my theme folder. Such as

    1) ./

    or

    2) ./wp-content/themes/theme_folder/

    What files and subdirectories?

    The only file you typically need call as a standard include/require is wp-blog-header.php, and that resides in your installation root. All standard template components can be loaded with the get_* functions listed above.

    To load non-standard templates from the active theme, you can employ the TEMPLATEPATH constant in WordPress:

    <?php include(TEMPLATEPATH . '/template-name.php'); ?>

    Beyond that I’m unsure what you’re asking about.

    I am referring to static pages that I create that I want controlled by WordPress themeing. For instance if I create a static ‘About’ page.

    From the Administration, click MANAGE > PAGES > CREATE NEW PAGE. In that window, you can choose the template you would like to have it “emulate”. Normally, people stick with the index.php file but you can create whatever template file style you want and choose that in the pull down box. Type in whatever you want into the edit window, and name the Page “About” and then save it. You are ready to go.

    Step by step instructions can be found at Creating individual Pages.

    Okay from the beginning.

    I already have a site created with alot of static and dynamic content. I am incorporating WP into this site. I want all content to be controlled by the WP Admin interface. Where do my static files go?

    1) Should I move my old site out of the httpdocs folder and install WP into the root? Then move my directory structure to the
    /wp-content/themes/theme-title/ folder.

    2) Should I leave my static files in place and install WP where it would logically go? For instance:
    mysite.com/personal/wordpress

    3) Or is there another way

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sub Directories Within WP 1.5’ is closed to new replies.