While trying to make WordPress and Galleria to become friends I already have a good result. Galleria can easily be used to display native WordPress Galleries. I'm using a plugin but that's not required at all. One thing that already made me pull my hair out, though: The thing I'm missing is a method to add an attribute
data-big to the image properties of the galleries' thumbnails as that will force Galleria to use the "full" image in fullscreen mode.
In HTML this would look like this
<div class="galleria"> <a href="/img/large1.jpg"><img src="/img/thumb1.jpg" data-big="/img/big1.jpg" data-title="My title" data-description="My description"></a> <a href="/img/large2.jpg"><img src="/img/thumb2.jpg" data-big="/img/big2.jpg" data-title="Another title" data-description="My description"></a> </div>
Where Galleria will use
<img> to display the thumbnail and the
<a href ...> for the regular image. That works like a charm and almost out of the box. But I didn't find a solution how to
- add an attribute
- pass the WP image size (e.g. "full") with that argument
Is there anybody who could point me into the right direction or give an example how to do that. Disclaimer: I have some experience with WP filters and hooks but I'm far from being a PHP expert.
Thanks in advance.
Edit: To be a bit more specific: the value for "data-big" is already available (the large/full-size image) so basically I'd like to add the new attribute to the tag and pass the URL of the full-size image.