Take a look at get_bloginfo
Thread Starter
zoion
(@zoion)
I can’t use an absolute path, I need a local path.
Use the get_template_directory() function.
$path_to_theme_directory = get_template_directory();
Also, that documentation on get_bloginfo was wrong, I’ve corrected it. It will also work for this case.
Thread Starter
zoion
(@zoion)
This is my setup.
In theme:
<?php include(TEMPLATEPATH . '/includes/random.inc.php'); ?>
<?php if (function_exists('randomWit')) echo randomWit(); ?>
In random.inc.php:
<?
function randomWit (
$textfile = "long local path to/random.txt" ){;
if ($quotes = @file("$textfile")) {
$quote = rand(0, sizeof($quotes)-1);
echo $quotes[$quote];
echo ("");
}};
?>
… Okay, but I fail to see how that’s relevant.
What, exactly, are you asking? Could you rephrase the question, perhaps in a way that will let us know what you’re talking about?
Thread Starter
zoion
(@zoion)
In random.inc.php I’d like to not hardcode the local path to random.txt, but I don’t quite know how.