• Hi,

    I have wordpress installed in a blog directory on a site. (www.thesite.co.uk/blog/) I need to include a navigtion file that holds the html for the “main site” in to the wordpress theme I am building, but when I try to use a standard php include, I fails to load it in.

    How do I make this work? I don’t really have to have two copies of the same file (one inside the WP dir & one outside in the main site) as it could lead to updating issues.

    Any ideas??

    Thanks

    Ash

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try

    <php include('(bloginfo('url')/whatever.inc')?>

    or

    <?php require_once(“./whatever.inc”); ?>

    Can’t guarantee either of them, haven’t tested, let me know if either of them works

    Thread Starter Ash

    (@ashbryant)

    nope nothing, sorry.

    Any other ideas??

    Absolute urls don’t work? e.g http:www/whatever.com/whatever.inc

    The other thing is that you usually have to go up directories from the theme e.g
    \..\..\..\whatever.inc

    I found a solution to this that works for me. Instead of an absolute path using http, try this…
    include($_SERVER[‘DOCUMENT_ROOT’].”/include/whatever.inc”);

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to include a file from outside of the wordpress directory’ is closed to new replies.