I'm making a theme for a client in WordPress and he wants each gallery to have a grouped lightbox, so there's a lightbox for each gallery. I found out you can make it add an attribute to the gallery automatically, so what I want is an attribute called 'class'
that has a number that adds by 1 for each gallery created. How would I do that?
Edit:
I see that I was not being specific enough so here's some more information:
I want a 'class=""'
attribute added automatically to the shortcode when the post gets created. Inside that class attribute I want it to have a number that goes up by 1 for each post containing a gallery. So the shortcode would end up like this: [gallery class="1" ...]
and the next [gallery class="2" ...]
and so on...