Get total image count in current album

Hey!

I display all images in an album in their default size on one page using a next_image loop, and I would like to also get a count of the total number of images. I'm a beginner with PHP and this is what I came up with:
`<?php $imgcount = 0; while (next_image()): $imgcount += 1; endwhile; print ($imgcount); ?>`
It works, but do I really need to iterate over the loop to get it?

I saw a function `getTotalImagesIn` exists, but can't figure out how to use it. I tried `print (getTotalImagesIn( getAlbumTitle( )));` but that fails with `Fatal error: Call to a member function getNumImages() on a non-object in /var/www/localhost/htdocs/zp/zp-core/template-functions.php on line 1985`

Comments

Sign In or Register to comment.