Im trying to have a random image show up on my homepage, but i want it to link to the actual image page it is contained on but it keeps reloading the page here is the code:
<?php $counter = 1;
while (next_album() and $counter == 1): ?>
" title="<?php echo getAnnotatedAlbumTitle();?>">
<?php makeImageCurrent(getRandomImages()); printDefaultSizedImage(getImageTitle());?> <?php $counter++;
endwhile; ?>
Comments
Also, your code must not be complete--as shown above there are some dangling constructs. To show code on this forum you should enclose it in 'peck' marks. (On a US PC keyboard that is the character below the tilda on the left end of the numeric key row.)
Anyway, somewhere there would need to be the href link to the image page.
`<?php next_album() ?>`
`" title="<?php echo getAnnotatedAlbumTitle();?>">`
`<?php makeImageCurrent(getRandomImages()); printDefaultSizedImage(getImageTitle());?>`
`<?php $randomImage = getRandomImages(); echo '<a href="'.htmlspecialchars(getURL($randomImage)).'" title="'.gettext('Random picture...').'">getSizedImage(getOption('image_size')) ).'" alt=."'.htmlspecialchars($randomImage->getTitle(), ENT_QUOTES).'" />';?>`
This should leave a default sized random image linking to it's regular image page. Hope that helps!