Forums

[resolved] 3 column and 4 column gallery on the home page breaks! (7 posts)

  1. meeble
    Member
    Posted 5 months ago #

    Hello,

    One of my posts has a 4 column gallery and another of my posts has a 3 column gallery, and on my home page, the existence of the 3 column gallery is breaking my 4 column gallery.

    You can see it here: http://meeble.com

    I know that it is happening because of a CSS issue, but I was wondering if this seems like a WP bug, or is it more likely a problem with my theme, plugins, etc?

    The more recent post has the 4 column gallery, which inserts this CSS:

    .gallery-item {
    width:25%;
    }

    which is then overruled by the older post's CSS:

    .gallery-item {
    width:33%;
    }

    Thoughts?

  2. meeble
    Member
    Posted 5 months ago #

    Doesn't it seems like each gallery should have a unique CSS code, something more like:

    .gallery1-item {
    width:25%;
    }

    gallery2-item {
    width:25%;
    }

  3. dvirsen
    Member
    Posted 5 months ago #

    Hello,

    Using inline snippets of css on your page is not the best way to do it.
    The page is not rendered chronologically with css and html parallel (finding style tag, applying it to html, then moving on until the next style tag updates the properties), so only the last css properties for the element is saved and used to render the page.

    Set that stuff in your stylesheet, and if you do it like you suggested, with seperate classes for the different galleries (like .gallery-25 and .gallery-33) that shouldn't be a problem.

  4. meeble
    Member
    Posted 5 months ago #

    I totally agree with you, but I didn't add those bits of inline CSS - I assumed WordPress did by default.

  5. alchymyth
    The Sweeper
    Posted 5 months ago #

    are you really using wp3.3 ?

    the gallery short code in wp3.3 seems to be different from your output, in a way that should solve your problem.

    see /wp-includes/media.php from line 749

  6. meeble
    Member
    Posted 5 months ago #

    Yes, I am on WP 3.3. Perhaps one of my plugins is interfering with the default WP gallery functionality? I'll check on that. It's not a theme issue, as I just changed themes to twentyeleven, and nothing changed.

  7. meeble
    Member
    Posted 5 months ago #

    Ok, I figured out that my "Lightbox Gallery" plugin was causing this issue. Thanks.

Reply

You must log in to post.

About this Topic