Title: Edit [gallery] Template Code
Last modified: August 19, 2016

---

# Edit [gallery] Template Code

 *  [ghowner](https://wordpress.org/support/users/ghowner/)
 * (@ghowner)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/)
 * Where can I edit the xhtml for this? That is, the gallery output.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Evita](https://wordpress.org/support/users/evita/)
 * (@evita)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/#post-843911)
 * At the moment, the only way I know is in wp-includes/media.php.
 *  [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/#post-843926)
 * You can change the XHTML output straight from within your post:
    [http://codex.wordpress.org/Using_the_gallery_shortcode](http://codex.wordpress.org/Using_the_gallery_shortcode)
 *  [Evita](https://wordpress.org/support/users/evita/)
 * (@evita)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/#post-843933)
 * Thanks greenshady, do you know if there is any code (for functions.php) to delete
   the whole css-style in media.php?
 *  Thread Starter [ghowner](https://wordpress.org/support/users/ghowner/)
 * (@ghowner)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/#post-844016)
 * Thanks greenshady. What I was attempting was to change how it outputs in a way
   of adding a new display functionality, but not just editing the column amount
   or minor changes.
 * Thanks Evita and greenshady, I’ll try it out today.
 *  [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/#post-844144)
 * I’ve actually done this with my [Cleaner Gallery plugin](http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-plugin)
   if you need an example of how it’s done.
 * There’s also the WordPress shortcode API that’ll let you remove shortcodes and
   replace them with your own (what I done with the above plugin):
    [http://codex.wordpress.org/Shortcode_API](http://codex.wordpress.org/Shortcode_API)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Edit [gallery] Template Code’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [default](https://wordpress.org/support/topic-tag/default/)
 * [edit](https://wordpress.org/support/topic-tag/edit/)
 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/edit-gallery-template-code/#post-844144)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
