Forums

[resolved] Adding my own include file links...how do I do it? (4 posts)

  1. wordman1994
    Member
    Posted 1 year ago #

    Hello,

    I wish to amend the footer with some information from an include file that I use throughout my website. Not having much luck at the moment.

    I added my include file into the wp-includes folder, then added this bit of code to footer.php:

    <?php include('/blog1/wp-includes/footer_bar.php'); ?>

    Apparently the path is not correct because I get errors. The error says I need this information:

    include_path='.:/usr/services/vux/lib/php'

    So, how do I set the correct path to include my, um, include file?

    PLEASE NOTE: I am KEEPING the WordPress info in the footer!!! Just adding my own site info along side it.

    Any help will be, GREATLY appreciated.

    Sincerely,

    Wordman

  2. iridiax
    Member
    Posted 1 year ago #

    Put the include files in your theme folder and use this in your theme's footer.php:

    <?php include (TEMPLATEPATH . '/footer_bar.php'); ?>

  3. wordman1994
    Member
    Posted 1 year ago #

    iridax,

    THANK YOU!!!

    Sincerely,

    Wordman

  4. wptomcat
    Member
    Posted 4 months ago #

    Sorry, daft question but I'm looking into this myself. I want to use a server side include myself, but don't see much point if the file to include has to sit within the Wordpress installation directories (thereby creating a second copy of the include file that I then have to remember to keep up to date - hope that makes sense).

    The whole point is I already have files I use as includes on my main site and would like to incorporate these within the blog. So, what would be the correct syntax to point to, say, the root folder - would it be this:

    <?php include('../includefile.php'); ?>

    Based on the assumption that Wordpress sits within it's own directory.

    Or was the answer above saying I would need to put my includes within my WordPress directory and change all the references from other parts of the site point to there?

    Andy

Topic Closed

This topic has been closed to new replies.

About this Topic