Image Count from Individual Default Gallery
-
I am trying to get a unique count of images in a given gallery (the default gallery). I would like to find both the total count of images as well as the current image.
For example, Now showing image 3 of 16. I have tried using something like:
$Gallery = get_the_title( $post->post_parent ); // this works fine $total_attachments = $wpdb->get_var(“SELECT COUNT(ID) FROM {$wpdb->prefix}posts WHERE post_type = ‘attachment’ AND post_parent = $Gallery”);
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Image Count from Individual Default Gallery’ is closed to new replies.