• Resolved meeble

    (@meeble)


    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: https://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?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter meeble

    (@meeble)

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

    .gallery1-item {
    width:25%;
    }

    gallery2-item {
    width:25%;
    }

    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.

    Thread Starter meeble

    (@meeble)

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

    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

    Thread Starter meeble

    (@meeble)

    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.

    Thread Starter meeble

    (@meeble)

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘3 column and 4 column gallery on the home page breaks!’ is closed to new replies.