So, below is the Wordpress default generated code for a gallery item:
<div id='gallery-1' class='gallery galleryid-203 gallery-columns-3 gallery-size-thumbnail'>
<dl class='gallery-item'>
<dt class='gallery-icon landscape'>
<a href='image url'><img width="150" height="120" src="thumbnail image" class="attachment-thumbnail"/></a>
</dt>
<dd class='wp-caption-text gallery-caption'>Caption Text</dd>
</dl>
</div>
What I need, is to surround the caption text with the image url, so when the user clicks on the caption it will open the big image, like this:
<dd class='wp-caption-text gallery-caption'><a href="image url">Caption Text</a></dd>
I know I can do this via image gallery with a href in the caption text, but the site is for a client and I want to be done dynamically.
I also found that this can be done in media.php (via functions.php), but I don't know how...
I hope I've made myself clear :)