WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to customize how my gallery shortcode works. eg. have a div for showing the image then a list of thumbnails at the bottom or side?

Or perhaps I can create a custom template file to loop through my page's gallery images?

share|improve this question
Check out some of the related questions(on the right of this page, scroll down a little), i know i've answered at least one question about modifying the gallery shortcode. – t31os Mar 8 '11 at 12:29
up vote 0 down vote accepted

You may complete override your gallery shortcode using the filter post_gallery. The return is displayed in your page and no further processing of the shortcode is done.

You may iterarate through the image attached to your post to build your own gallery.

See the implementation of gallery shortcode here: http://core.trac.wordpress.org/browser/trunk/wp-includes/media.php#L758

EDIT: There are some plugins that modify the default behaviour of the gallery shortcode. Search it from the "Add New Plugin" of the backend. Use the string "gallery shortcodes".

Note: if you want you can use nextgen-gallery to manage your photos. It has numerous plugin to display with other gallery, like Smooth Gallery, Nivo Slider or jQuery cycle.

share|improve this answer

I would recommend the Attachments plugin instead of using the gallery, it uses the regular wordpress media library, but you can control the output much more easily. If you pair it up with add_image_size you can create a range of different thumbnails.

share|improve this answer

Your Answer


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.