Support » Fixing WordPress » Gallery thumbnails in single column no matter what the setting

  • Resolved RoseCitySister

    (@rosecitysister)


    I am having an awful time trying to find out what is wrong here. The theme I’m working on is at http://rosecitygardens.com/playpen/post-format-gallery/ – you can see from this page that all of the thumbnails are in a single row. I’ve tried everything, deleting the gallery and making a new one. It works fine with two other themes I’ve done after I added some style but it won’t work on this one and I can’t figure out why. I’m sure it must be in my stylesheet but I’m damned if I can find it.

    Can someone please help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Wouldn’t you know it – five minutes after I posted this, I discovered what was hanging me up. I had this in my functions.php from messing around with the settings yesterday:

    function haunted_remove_gallery_css( $css ) {
    	return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
    }
    add_filter( 'gallery_style', 'haunted_remove_gallery_css' );
    Michael

    (@alchymyth)

    Forum Moderator

    some code in your theme seem to have suppressed the output of the gallery CSS (possibly using a filter?) without adding your own styles;

    try adding some CSS like:

    .gallery.gallery-columns-4 {
    	margin: auto;
    }
    .gallery.gallery-columns-4  .gallery-item {
    	float: left;
    	margin-top: 10px;
    	text-align: center;
    	width: 25%;
    }
    .gallery.gallery-columns-4  img {
    	border: 1px solid #cfcfcf;
    }
    .gallery.gallery-columns-4  .gallery-caption {
    	margin-left: 0;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gallery thumbnails in single column no matter what the setting’ is closed to new replies.