API to query galleries for number of images?
-
Would like to know a way to determine in PHP code if a gallery exists, and how many images it contains. Reason for this is that I have a list of hyperlinks to posts, and I want to add an icon to each link to show if there are images. Right now I am querying the database directly but this is kind of messy. I am looking in the postmeta table and the key “foogallery_attachments” but the key value is sort of cryptic. When there are no images, the key value contains “a:1” but if there are 3 images, the key value contains “a:3”, and that’s odd. Any help appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘API to query galleries for number of images?’ is closed to new replies.