Hi,
What do I have to modify in the following code to get rid of the random function and to specify one image to be displayed as heading image?
[quote]
function printHeadingImage($randomImage) {
global $_zp_themeroot;
$id = getAlbumId();
echo '';
if (is_null($randomImage)) {
echo '';
} else {
$randomAlbum = $randomImage->getAlbum();
$randomAlt1 = $randomAlbum->getTitle();
if ($randomAlbum->getAlbumId() $id) {
$randomAlbum = $randomAlbum->getParent();
while (!is_null($randomAlbum) && ($randomAlbum->getAlbumId() $id)) {
$randomAlt1 = $randomAlbum->getTitle().":\n".$randomAlt1;
$randomAlbum = $randomAlbum->getParent();
}
}
$randomImageURL = htmlspecialchars(getURL($randomImage));
if (getOption('allow_upscale')) {
$wide = 620;
$high = 180;
} else {
$wide = min(620, $randomImage->getWidth());
$high = min(180, $randomImage->getHeight());
}
echo "
Modify the file /themes/effervesence_plus/functions.php, line 152.
I haven't played with this theme, so I don't know what issues there may be with breaking the layout if you use a differently sized image, but regardless, that's where the line is that prints the image heading for each of the theme pages.
Actually, I'll post the block of code also, in case you've already modified the file and it's not line 152 anymore:
function printLogo() { global $_zp_themeroot; if ($img = getOption('Graphic_logo')) { echo '[img]'.$_zp_themeroot.'/images/'.$img.'.png[/img]'; } else { $name = getOption('Theme_logo'); if (empty($name)) { $name = sanitize($_SERVER['HTTP_HOST']); } echo "$name"; } }
It would be the line that reads: echo '
Well, now I've looked more closely at the theme, and I see which image you're talking about. So, now I think I can answer the question you asked, not the one I thought you meant :-)
Perhaps the easiest way is to modify the function you posted in your original post. Add the following line above the one beginning with 'global $_zp_theme_root;':
$randomImage = NULL
That will force it to use the hard-coded image a few lines down. Now, modify that line to point to the image you want to use - again, noting that a differently sized image may adversely affect the theme layout. The line to modify is:
echo '[img]'.$_zp_themeroot.'/images/zen-logo.jpg[/img]';
In the above line, if you put the image in the theme's images folder, just replace 'zen-logo.jpg' with the filename you use.
Hope that helps!