How do I show the number of images attached to a post on the image attachment page?

Posted by mattloak on Stack Overflow See other posts from Stack Overflow or by mattloak
Published on 2010-03-20T22:20:18Z Indexed on 2010/03/20 22:21 UTC
Read the original article Hit count: 171

I use the image attachment page to show images attached to a post one by one, in a slideshow sort of affect. I'd like to be able to display the total number of images attached to the parent post and the number of the particular image that's being shown on any given attachment page so you see the picture and the words "Image 3 of 15" for example.

I've played around with some different code and can get the total number of images to show on the post page, but when I insert the code on the attachment page template it always shows "1 of 1." I was having this problem a while ago and decided to re-address it, unfortunately I don't have the original code that I used and can't remember it.

Anyone have any suggestions?

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about wordpress-theming