Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The default gallery structure of WordPress is really tortuous:

<div id="gallery-1" class="gallery...">
    <dl class="gallery-item">
        <dt class="gallery-icon">
            <a title="01Exam" href="bar">
                <img title="then my image" src="foo.jpg">
            </a>
        </dt>
    </dl>
</div>

Can you help me to output a simple list of images just like:

<ul class="gallery-item">
    <li>
        <img title="then my image" src="foo.jpg">
    <li>
</ul>
share|improve this question
    
I found how to change default <dl> and <dt> using [gallery itemtag="div" icontag="span"] but not how to remove it. –  rooofl Jun 18 '11 at 9:59
    
There's several related questions shown to the right(under the "Related" heading) that would of provided ample solutions to this question, just an FYI. –  t31os Jun 19 '11 at 10:01
add comment

1 Answer

Use your own gallery shortcode handler - something like this in your functions.php:

function __my_gallery_shortcode( $attr )
{
     // render the gallery the way you want it
}
add_shortcode( 'gallery', '__my_gallery_shortcode' );

To get you started, you could just copy the code from the default handler gallery_shortcode(), and edit as you require.

share|improve this answer
    
Sadly there's really no better way to do this... –  kaiser Jun 18 '11 at 14:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.