I have altered my theme to detect when it is showing images by evaluating whether next_image() returns TRUE or FALSE. I then present some html bits if it evaluates TRUE and also go through the while loop to show all the images of an album.
The problem is that most of the time it works, but in some albums it wont show any photos, although it does evaluate to TRUE.
if(next_image(TRUE, NULL, NULL))
{
//do bits here ?>
<div id="thumbcontainer">
<?php while (next_image(TRUE, NULL, NULL)): ?>
// print thumbs
<?php endwhile; ?>
</div>
<?php
// do some more bits here
}
If I just leave the while loop it goes through all images. If I include it in the if statement, it does not, although the it evaluates to TRUE. Please note this 'unexpected behaviour' happens only in very few albums.
Any ideas why next_image() would not return images?
Comments