The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Remove css gallery (3 posts)

  1. newboxters
    Posted 7 years ago #

    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).

  2. westondeboer
    Posted 7 years ago #

    Add this into functions.php

    add_filter('gallery_style', create_function('$a', 'return "
    <div class=\'gallery\'>";'));
  3. scottoliphant
    Posted 6 years ago #

    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;


Topic Closed

This topic has been closed to new replies.

About this Topic