3

I'm sorry if this question was answered here, but I couldn't find it. Is possible to change the HTML output of [gallery] shortcode (without plugins)? I would like to show the thumbnails as another appearance. Is this possible? Thanks!

1
  • Have you seen this?
    – fuxia
    Commented Mar 18, 2013 at 22:28

1 Answer 1

12

The source for the gallery shortcode is in wp-includes/media.php. There are a couple of hooks in there that might work for you. Without knowing exactly what you want to do, it is impossible to be more specific.

If that doesn't work then you can remove the shortcode:

remove_shortcode('gallery');

And add another gallery shortcode with the alterations you want. Just copy the function to functions.php or to a plugin file, rename it, edit it, and add it back with add_shortcode('gallery', 'whatever_you_named_your_function');

2
  • Great! It works for me.
    – gregolin
    Commented Mar 25, 2013 at 21:03
  • 1
    If this solved the question please mark it as "Accepted". Look for the check mark on the left.
    – s_ha_dum
    Commented Jun 24, 2013 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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