Title: Remove css gallery
Last modified: August 19, 2016

---

# Remove css gallery

 *  [newboxters](https://wordpress.org/support/users/newboxters/)
 * (@newboxters)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/remove-css-gallery/)
 * In wp-includes/media.php
    Line: 642 – 657
 * How to remove that css <style type=’text/css’> what does show in the gallery 
   for me to use the css of my theme? – That filter should use for not altering 
   the file it media.php (because it can return to the normal after upgrade of WP).

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

 *  [westondeboer](https://wordpress.org/support/users/poil11/)
 * (@poil11)
 * [17 years ago](https://wordpress.org/support/topic/remove-css-gallery/#post-1011247)
 * Add this into functions.php
 *     ```
       add_filter('gallery_style', create_function('$a', 'return "
       <div class=\'gallery\'>";'));
       ```
   
 *  [scottoliphant](https://wordpress.org/support/users/scottoliphant/)
 * (@scottoliphant)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/remove-css-gallery/#post-1011271)
 * also, add this is your themes css:
 *     ```
       <style type='text/css'>
               .gallery {
                       margin: auto;
               }
               .gallery-item {
                       float: left;
                       margin-top: 10px;
                       text-align: center;
                       width: 33%;
               }
               .gallery img {
                       border: 2px solid #cfcfcf;
               }
               .gallery-caption {
                       margin-left: 0;
               }
       </style>
       ```
   
 * per:
    [http://sivel.net/2009/02/remove-gallery-style-tags-one-liner/](http://sivel.net/2009/02/remove-gallery-style-tags-one-liner/)

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

The topic ‘Remove css gallery’ is closed to new replies.

## Tags

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

 * 2 replies
 * 3 participants
 * Last reply from: [scottoliphant](https://wordpress.org/support/users/scottoliphant/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/remove-css-gallery/#post-1011271)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
