WordPress Media Gallery - Please, that can't be true ...

  1. Pret en devises

    Hi everyone,

    I think I've got some nice suggestion here : did some of you tried PDW File Browser (as CKeditor module) ?

    Although it uses a little processor to compute thumbnails I think it would kindof a nice replacement
    ( could be lighter : option to not display thumbnails + kindof sqlite search through files tree ) for the current image + files management

    Posted: 5 years ago #
  2. Ipstenu (Mika Epstein)
    Lead Plugin Wrangler

    Before you jump into that, check out the new media manager in 3.5 - It helps the gallery a lot!

    Posted: 5 years ago #
  3. I found this thread because I wanted to remove the borders from the images, Seems like even with 3.5 the CSS is still hard coded into the site.

    Should an attribute not be added to the short code?

    I would make this change and gladly open a pull request.

    Posted: 5 years ago #
  4. Alright,

    As I was adding a shortcode attribut for style=none I saw:

    if ( apply_filters( 'use_default_gallery_style', true ) )

    The only instance of this was found in the Twenty Ten theme:

    add_filter( 'use_default_gallery_style', '__return_false' );

    Will remove all styles from WordPress, I think having this is a media option rather hidden in the code, or in function.php is not the best option.

    Posted: 5 years ago #
  5. Ipstenu (Mika Epstein)
    Lead Plugin Wrangler

    Borders can be changed with CSS, still. Where are you seeing it that makes you think it's hard coded?

    Posted: 5 years ago #
  6. In wp-include/media.php

    #{$selector} {
    margin: auto;
    #{$selector} .gallery-item {
    float: {$float};
    margin-top: 10px;
    text-align: center;
    width: {$itemwidth}%;
    #{$selector} img {
    border: 2px solid #cfcfcf;
    #{$selector} .gallery-caption {
    margin-left: 0;

    I turned it off with te above filter.

    Posted: 5 years ago #
  7. Ipstenu (Mika Epstein)
    Lead Plugin Wrangler

    Ah, semantics :) They're not 'hard coded' (that would be if they were use style="margin-top:10px;...." and so on). They're defining default CSS.

    Which, again, you can override in your theme :)

    Posted: 5 years ago #
  8. Drew Jaynes
    Docs Czar


    It's worth pointing out several things ... again:

    • The CSS is hardcoded because it's in a shortcode.
    • You can disable the hardcoded CSS with add_filter( 'use_default_gallery_style', '__return_false' );
    • You can override the default gallery styles and output with the gallery_style filter.
    Posted: 5 years ago #
  9. Thanks drew

    At least we shall never forget the css priorities !
    #id = 100

    making #id1 #id2 priority 200
    #id1 .class priority 110
    and last rule having same priority overrides the previous one

    Posted: 5 years ago #
  10. Unsal Korkmaz


    You cant make everyone happy with default settings.
    When you happy, someone will not like result.
    This is why there is actions and filters.

    You can check my solution for gallery:
    used bootstrap carousel for galleries

    Posted: 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    196 Votes
  • Status

    This idea has been implemented