Support » Fixing WordPress » Gallery not working on home page…fine on single

  • Have standard [gallery columns="5"] shortcode for my gallery and it woks perfectly on my sinle post page without issue, but on my home page it is all messed up.
    http://www.celebridiot.com/2009/06/28/megan-fox-leaving-fuse-studios/ – fine
    http://www.celebridiot.com/ – messed up
    I checked the page source and it looks identical Any ideas?????
    <style type=’text/css’>
    .gallery {
    margin: auto;
    }
    .gallery-item {
    float: left;
    margin-top: 10px;
    text-align: center;
    width: 20%; }
    .gallery img {
    border: 2px solid #cfcfcf;
    }
    .gallery-caption {
    margin-left: 0;
    }
    </style>

    <!– see gallery_shortcode() in wp-includes/media.php –>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The problem with having multiple galleries within the home page is that the settings for the most recent gallery affect all of the other galleries on the page. Two options:

    1. Don’t display galleries on the home page.

    2. Rewrite the gallery shortcode in functions.php to take the CSS out of the page body and place it on the theme’s stylesheet instead (where it rightfully belongs) so that you only have 1 CSS block for any and all galleries.

    I was not aware of that fact that one code impacts all other.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gallery not working on home page…fine on single’ is closed to new replies.