Forums

script path inside post or page (3 posts)

  1. waveminded
    Member
    Posted 1 year ago #

    On one of my static WP pages I want to include a file, code:
    <?php include('info.php') ?>

    I have scripts working in posts, the problem is I can't figure out the path its supposed to be. Right now the info.php file resides in my theme directory, should it be somewhere else?

  2. danielerossi
    Member
    Posted 1 year ago #

    Anyone? I'm having the same problem. I have a php file in my theme folder and would like to insert an include tag on a page to access it.

    I've tried all sorts of paths :
    <?php include (TEMPLATEPATH . '/header2.php'); ?>
    <?php include ('header2.php'); ?>
    <?php include ('../header2.php'); ?>
    <?php include ('../../header2.php'); ?>
    <?php include ('../../../header2.php'); ?>

    ...but nothing is dsiplayed. What is the proper path? Can WordPress (2.5.) even do this? I've done a search on these forums and it seems that no solution has been posted.

  3. haochi
    Member
    Posted 1 year ago #

    WordPress doesn't do that out of box, but plugins do.
    http://wordpress.org/extend/plugins/exec-php/

    I believe that's what you want to do.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.