WordPress.org

Forums

Remove css gallery (3 posts)

  1. newboxters
    Member
    Posted 6 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
    Member
    Posted 6 years ago #

    Add this into functions.php

    add_filter('gallery_style', create_function('$a', 'return "
    <div class=\'gallery\'>";'));
  3. scottoliphant
    Member
    Posted 5 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;
            }
    </style>

    per:
    http://sivel.net/2009/02/remove-gallery-style-tags-one-liner/

Topic Closed

This topic has been closed to new replies.

About this Topic