I am trying to preview a NextGen gallery on my main page (and category pages) to show a single image from the gallery on the main page next to the text from the post that normally shows up. I have found examples of PHP that get the images from a gallery given a gallery ID. In my loop I have a current post. What I cannot figure out is how to, given a post, get the attributes of the [nggallery] short code.
In other words for each post with a NextGEN gallery I need the id value form the short code. For example if the post contains [nggallery id=50]
I need the value 50
.
How can I get that information from a post?
I was hoping to find the solution in the source code of the next gen plug-in but of course that code registered a short code handler and lets WP call them back. There are no examples in their source code where they parse a post looking for their short code.