I've been trying to sort this out for the past half hour.
I have a file, ue_variables.php which I want to include throughout the WordPress theme, the contents of the file is:
if(!empty($_SERVER['HTTP_REFERER'])) {
$url_referrer = $_SERVER['HTTP_REFERER'];
$explode = explode(".",$url_referrer);
$name_referrer = ucfirst($explode);
} else {
$url_referrer = "default";
$name_referrer = "default";
}
date_default_timezone_set("UTC");
$time = date("H:i:s");
$date = date("j F Y");
I want to include it in header.php so that the user can echo variables in a post (they've already got the Exec-PHP plugin setup, so that itself isn't a problem).
First I was being stupid about it, attempting to include it from the WordPress root folder (which doesn't even contain header.php), then I swapped out the false relative link for a true absolute one, and now my WordPress page is breaking, from the point of inclusion downwards.
E.g. I place <?php include("/absolute/path/ue_variables.php"); ?> at the top of header.php and the whole index page wont load. I place it at the bottom, and only the header section of the blog loads (e.g. header and nav).
Any ideas as to why this is happening and measures to rectify it would be greatly, greatly, appreciated!! :)
$time = x;and$date = x;out and placed them inheader.php, and attempted to echo them from a post, - Avicinnianecho()is contained has anything to do with it, all the strings either side of<?php echo($time); ?>in my post are rendering fine. - Avicinnian