I have read through many posts and articles about styling a WordPress Gallery, but I would like to change the structure. Below is an example of a normal gallery code. I want to remove the <dl> <dt> <br> and replace them with my own elements. Any idea where I can do this in the WordPress file structure?
<div id="gallery-1" class="gallery galleryid-1 gallery-columns-1 gallery-size-thumbnail">
<dl class="gallery-item">
<dt class="gallery-icon">
<a href="http://mydomain.com/2012/01/hello-world/dsc_0003/" title="DSC_0003"><img width="376" height="250" src="http://mydomain.com/wp-content/uploads/2012/01/DSC_0003-376x250.jpg" class="attachment-thumbnail" alt="DSC_0003" title="DSC_0003"></a>
</dt>
</dl>
<br style="clear: both">
<dl class="gallery-item">
<dt class="gallery-icon">
<a href="http://mydomain.com/2012/01/hello-world/dsc_0003/" title="DSC_0003"><img width="376" height="250" src="http://mydomain.com/wp-content/uploads/2012/01/DSC_0003-376x250.jpg" class="attachment-thumbnail" alt="DSC_0003" title="DSC_0003"></a>
</dt>
</dl>
<br style="clear: both">
</div>
Any help would be greatly appreciated. Thank you.
If one did want to further customize the default post gallery you can add a filter to post_gallery to produce your own output. if the post_gallery filter returns anything, the default gallery output will be ignored. as a starting point, look at the gallery shortcode function, which is located in /wp-includes/media.php. it uses get_posts to fetch attachments and output them. you could copy that function entirely into your functions.php file and change the name and use that as your filter.