Right now I’m using a code in the functions to override the default WordPress gallery CSS. But it seems for some reason that WP only wants to let me put 3 images per line in a gallery, despite my CSS. Anybody know how to fix this? My problem can be found here -> http://themeforward.com/demo2/features/gallery-2/ and my CSS is below.
/*////////////////////////////////////////////////////////////////////
// Gallery
////////////////////////////////////////////////////////////////////*/
.gallery {
margin:30px 0 auto!important;
text-align:center;
width:680px;
overflow:hidden;
background:#1a1a1a
}
.gallery-item {
float:left;
text-align:center;
background:#000
}
.gallery img {
display:inline
}
.gallery img:active {
}
.gallery-caption {
display:none;
font-size:.8em;
margin-left:0
}
.gal_img {
margin:20px auto 0!important;
text-align:center
}
.gal_caption p {
font-size:1.3em!important;
font-weight:640;
text-align:center;
font-family:Arial, Helvetica, sans-serif!important
}
.gal_description p {
font-size:1.1em!important;
text-align:center
}
EDIT:
//////////////////////////////////////// Gallery
add_filter('gallery_style',
create_function(
'$css',
'return preg_replace("#<style type='text/css'>(.*?)</style>#s", "", $css);'
)
);
//////////////////////////////////////// Remove default gallery styling
add_filter( 'use_default_gallery_style', '__return_false' );
You have to account for all appropriate CSS classes, based on the number of columns passed to the shortcode. Here’s my CSS (borrowed heavily from Michael Fields), for handling from 1 to 10 columns:
EDIT
Here you can see an example of the markup and styles being applied, from calling the following in the Post Content: