Hi - can anyone see why an image is displaying only in IE6,7,8 but not in any other browser?
Altho’ I’m using wordpress, the problem is in the php that points to the relative location of the image. Before wordpress, to use relative links, I had a blank root.php file in root folder, then I had this in html above doctype:
<?php
if (file_exists(“./root.php”)) {
$rpath = “.”;}
else {
$rpath = “…”; }
?>
Then a relative link looked like this in html mode - by “html mode” I mean when you have img src= or a href= :
<img src=“<?php echo $rpath ?>/gr-pg/top.gif” alt=
And a relative link looked like this in php mode:
<?php include(“$rpath/1cde/header.php”); ?>
To point to root in Wordpress, when in html mode you use:
“<?php bloginfo(‘template_directory’); ?>”
e.g.
<img src=“<?php bloginfo(‘template_directory’); ?>/gr-pg/top.gif”
When in php mode, you use “TEMPLATEPATH .”:
e.g.
<?php include(TEMPLATEPATH . ‘/1cde/header.php’); ?>
Now in wordpress, in my footernav.php, I call up a testimonial at random from testim.php like this - it works perfectly x-browser with TEMPLATEPATH .:
footernav.php:
<?php include(TEMPLATEPATH . ‘/1cde/testim.php’); ?>
<?php echo $select; ?>
testim.php:
<?php
$spr3 = array(‘spr301’, ‘spr302’, ‘spr303’, ‘spr304’);
$i = rand(0, count($spr3)-1);
$select = file_get_contents(TEMPLATEPATH . ‘/1txt/’.$spr3[$i].‘.txt’);
?>
BUT my problem is in my header.php I’m trying to call up a random recipe
photo, but I can’t get the final line in recip.php to work with
wordpress’s TEMPLATEPATH.
header.php:
<?php include(TEMPLATEPATH . ‘/1cde/recip.php’); ?>
<img src=“<?php echo $select; ?>” alt=“raw recipes” width=“100px”
height=“100px” />
recip.php:
<?php
$photos = array(‘rec01’, ‘rec02’, ‘rec03’, ‘rec04’, ‘rec05’, ‘rec06’, ‘rec07’, ‘rec08’, ‘rectama’);
$i = rand(0, count($photos)-1);
$select = TEMPLATEPATH . ‘/gr-pg/’.$photos[$i].‘.jpg’;
//below is what it was before wordpress, worked perfectly xbrowser:
//$select = $rpath.‘/gr-pg/’.$photos[$i].‘.jpg’; -
?>
IE is the only browser displaying the recipe photo. All the others can’t read it. I can’t understand why all browsers are reading the testimonial in:
$select = file_get_contents(TEMPLATEPATH . ‘/1txt/’.$spr3[$i].‘.txt’);
but none except IE can read the recipe in:
$select = TEMPLATEPATH . ‘/gr-pg/’.$photos[$i].‘.jpg’;
Can you perhaps see how to do it? It’s just this one line:
$select = $rpath.‘/gr-pg/’.$photos[$i].‘.jpg’;
where I need to replace “$rpath.” with wordpress’s way of doing it, using “TEMPLATEPATH .”
OR will wordpress’s:
<?php bloginfo(‘template_directory’); ?>
fit into that line somehow?
thanks million! - Val