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="https://wordpress.stackexchange.com/questions/20341/bar">
                <img title="then my image" src="https://wordpress.stackexchange.com/questions/20341/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="https://wordpress.stackexchange.com/questions/20341/foo.jpg">
    <li>
</ul>

1
1

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.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *