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?
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.
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.