1) this is the code to get an alternate header =
<?php include (TEMPLATEPATH . '/header2.php'); ?>
2) i moved a file outside of the wp directory and that file is now looking for header2.
i tried this but it does not work =
<?php include (TEMPLATEPATH . 'http://www.domain.com/wp-content/themes/theme/header2.php'); ?>
TEMPLATEPATH is the template URL (http://www.domain.com/wp-content/themes/theme) and the period is concatenation, which means that the template URL is added to whatever follows it.
i understand the function and concatenation. it would seem an absolute path would find the header.php but then, again, maybe i don't understand.
i get these error codes, i.e., can't find header2.php
Warning: main(TEMPLATEPATH/header2.php) [function.main]: failed to open stream: No such file or directory in /home/code/public_html/enter.php on line 18
Warning: main() [function.include]: Failed opening 'TEMPLATEPATH/header2.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php') in /home/code/public_html/enter.php on line 18
TEMPLATEPATH is a special WordPress function, so it can only be used within WordPress. Try a regular php include instead.
tried it both ways - both in and out of wp - and moved the file back inside wp, though in the wp root and the wp-contents.
thanks iridiax
drmanry
Member
Posted 10 months ago #
ronchicago,
Since you're supplying an absolute path, just use
<?php include ('http://www.domain.com/wp-content/themes/theme/header2.php'); ?>