Title: Gallery php code location?
Last modified: August 19, 2016

---

# Gallery php code location?

 *  [ghaib](https://wordpress.org/support/users/ghaib/)
 * (@ghaib)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/gallery-php-code-location/)
 * When a gallery is posted into the post (the WP gallery — no plugin), the following
   code is automatically added after the gallery:
 * > <br style=”clear: both” /><br style=’clear: both;’ />
 * Where in the WP files can you edit the php code in order to remove those two 
   break lines? I’ve searched all the files and can’t find it anywhere.
 * Note: this is not a plug-in, but the gallery that’s part of WP (2.8.4)
 * Thanks!

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/gallery-php-code-location/#post-1262005)
 * Try wp-includes/media.php. Personally, I re-write the gallery shortcode function
   within my theme’s functions.php file and replace the native shortcode function
   using:
 *     ```
       remove_shortcode('gallery');
       add_shortcode('gallery', 'theme_gallery_shortcode');
       ```
   
 *  Thread Starter [ghaib](https://wordpress.org/support/users/ghaib/)
 * (@ghaib)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/gallery-php-code-location/#post-1262096)
 * Thanks, that did it.
 * What does the “native shortcode” accomplish for you?

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

The topic ‘Gallery php code location?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [ghaib](https://wordpress.org/support/users/ghaib/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/gallery-php-code-location/#post-1262096)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
